fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
3.5 KiB160 linesraw
1error: comparison operators cannot be chained
2  --> $DIR/chained-comparison-suggestion.rs:4:7
3   |
4LL |     1 < 2 <= 3;
5   |       ^   ^^
6   |
7help: split the comparison into two
8   |
9LL |     1 < 2 && 2 <= 3;
10   |           ^^^^
11
12error: comparison operators cannot be chained
13  --> $DIR/chained-comparison-suggestion.rs:9:7
14   |
15LL |     1 < 2 < 3;
16   |       ^   ^
17   |
18help: split the comparison into two
19   |
20LL |     1 < 2 && 2 < 3;
21   |           ^^^^
22
23error: comparison operators cannot be chained
24  --> $DIR/chained-comparison-suggestion.rs:13:7
25   |
26LL |     1 <= 2 < 3;
27   |       ^^   ^
28   |
29help: split the comparison into two
30   |
31LL |     1 <= 2 && 2 < 3;
32   |            ^^^^
33
34error: comparison operators cannot be chained
35  --> $DIR/chained-comparison-suggestion.rs:18:7
36   |
37LL |     1 <= 2 <= 3;
38   |       ^^   ^^
39   |
40help: split the comparison into two
41   |
42LL |     1 <= 2 && 2 <= 3;
43   |            ^^^^
44
45error: comparison operators cannot be chained
46  --> $DIR/chained-comparison-suggestion.rs:23:7
47   |
48LL |     1 > 2 >= 3;
49   |       ^   ^^
50   |
51help: split the comparison into two
52   |
53LL |     1 > 2 && 2 >= 3;
54   |           ^^^^
55
56error: comparison operators cannot be chained
57  --> $DIR/chained-comparison-suggestion.rs:28:7
58   |
59LL |     1 > 2 > 3;
60   |       ^   ^
61   |
62help: split the comparison into two
63   |
64LL |     1 > 2 && 2 > 3;
65   |           ^^^^
66
67error: comparison operators cannot be chained
68  --> $DIR/chained-comparison-suggestion.rs:32:7
69   |
70LL |     1 >= 2 > 3;
71   |       ^^   ^
72   |
73help: split the comparison into two
74   |
75LL |     1 >= 2 && 2 > 3;
76   |            ^^^^
77
78error: comparison operators cannot be chained
79  --> $DIR/chained-comparison-suggestion.rs:36:7
80   |
81LL |     1 >= 2 >= 3;
82   |       ^^   ^^
83   |
84help: split the comparison into two
85   |
86LL |     1 >= 2 && 2 >= 3;
87   |            ^^^^
88
89error: comparison operators cannot be chained
90  --> $DIR/chained-comparison-suggestion.rs:41:7
91   |
92LL |     1 == 2 < 3;
93   |       ^^   ^
94   |
95help: parenthesize the comparison
96   |
97LL |     1 == (2 < 3);
98   |          ^     ^
99
100error: comparison operators cannot be chained
101  --> $DIR/chained-comparison-suggestion.rs:45:7
102   |
103LL |     1 > 2 == false;
104   |       ^   ^^
105   |
106help: parenthesize the comparison
107   |
108LL |     (1 > 2) == false;
109   |     ^     ^
110
111error: comparison operators cannot be chained
112  --> $DIR/chained-comparison-suggestion.rs:49:7
113   |
114LL |     1 == 2 == 3;
115   |       ^^   ^^
116   |
117help: split the comparison into two
118   |
119LL |     1 == 2 && 2 == 3;
120   |            ^^^^
121
122error[E0308]: mismatched types
123  --> $DIR/chained-comparison-suggestion.rs:4:14
124   |
125LL |     1 < 2 <= 3;
126   |              ^ expected `bool`, found integer
127
128error[E0308]: mismatched types
129  --> $DIR/chained-comparison-suggestion.rs:13:14
130   |
131LL |     1 <= 2 < 3;
132   |              ^ expected `bool`, found integer
133
134error[E0308]: mismatched types
135  --> $DIR/chained-comparison-suggestion.rs:18:15
136   |
137LL |     1 <= 2 <= 3;
138   |               ^ expected `bool`, found integer
139
140error[E0308]: mismatched types
141  --> $DIR/chained-comparison-suggestion.rs:23:14
142   |
143LL |     1 > 2 >= 3;
144   |              ^ expected `bool`, found integer
145
146error[E0308]: mismatched types
147  --> $DIR/chained-comparison-suggestion.rs:36:15
148   |
149LL |     1 >= 2 >= 3;
150   |               ^ expected `bool`, found integer
151
152error[E0308]: mismatched types
153  --> $DIR/chained-comparison-suggestion.rs:49:15
154   |
155LL |     1 == 2 == 3;
156   |               ^ expected `bool`, found integer
157
158error: aborting due to 17 previous errors
159
160For more information about this error, try `rustc --explain E0308`.