fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.8 KiB172 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   |     |
128   |     expected because this is `bool`
129
130error[E0308]: mismatched types
131  --> $DIR/chained-comparison-suggestion.rs:13:14
132   |
133LL |     1 <= 2 < 3;
134   |     ------   ^ expected `bool`, found integer
135   |     |
136   |     expected because this is `bool`
137
138error[E0308]: mismatched types
139  --> $DIR/chained-comparison-suggestion.rs:18:15
140   |
141LL |     1 <= 2 <= 3;
142   |     ------    ^ expected `bool`, found integer
143   |     |
144   |     expected because this is `bool`
145
146error[E0308]: mismatched types
147  --> $DIR/chained-comparison-suggestion.rs:23:14
148   |
149LL |     1 > 2 >= 3;
150   |     -----    ^ expected `bool`, found integer
151   |     |
152   |     expected because this is `bool`
153
154error[E0308]: mismatched types
155  --> $DIR/chained-comparison-suggestion.rs:36:15
156   |
157LL |     1 >= 2 >= 3;
158   |     ------    ^ expected `bool`, found integer
159   |     |
160   |     expected because this is `bool`
161
162error[E0308]: mismatched types
163  --> $DIR/chained-comparison-suggestion.rs:49:15
164   |
165LL |     1 == 2 == 3;
166   |     ------    ^ expected `bool`, found integer
167   |     |
168   |     expected because this is `bool`
169
170error: aborting due to 17 previous errors
171
172For more information about this error, try `rustc --explain E0308`.