fork/rust

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

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

master
6.2 KiB148 linesraw
1error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
2  --> $DIR/absurd-extreme-comparisons.rs:14:5
3   |
4LL |     u <= 0;
5   |     ^^^^^^
6   |
7   = help: because `0` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == 0` instead
8   = note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
9   = help: to override `-D warnings` add `#[allow(clippy::absurd_extreme_comparisons)]`
10
11error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
12  --> $DIR/absurd-extreme-comparisons.rs:16:5
13   |
14LL |     u <= Z;
15   |     ^^^^^^
16   |
17   = help: because `Z` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == Z` instead
18
19error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
20  --> $DIR/absurd-extreme-comparisons.rs:18:5
21   |
22LL |     u < Z;
23   |     ^^^^^
24   |
25   = help: because `Z` is the minimum value for this type, this comparison is always false
26
27error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
28  --> $DIR/absurd-extreme-comparisons.rs:20:5
29   |
30LL |     Z >= u;
31   |     ^^^^^^
32   |
33   = help: because `Z` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `Z == u` instead
34
35error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
36  --> $DIR/absurd-extreme-comparisons.rs:22:5
37   |
38LL |     Z > u;
39   |     ^^^^^
40   |
41   = help: because `Z` is the minimum value for this type, this comparison is always false
42
43error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
44  --> $DIR/absurd-extreme-comparisons.rs:24:5
45   |
46LL |     u > u32::MAX;
47   |     ^^^^^^^^^^^^
48   |
49   = help: because `u32::MAX` is the maximum value for this type, this comparison is always false
50
51error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
52  --> $DIR/absurd-extreme-comparisons.rs:26:5
53   |
54LL |     u >= u32::MAX;
55   |     ^^^^^^^^^^^^^
56   |
57   = help: because `u32::MAX` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u == u32::MAX` instead
58
59error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
60  --> $DIR/absurd-extreme-comparisons.rs:28:5
61   |
62LL |     u32::MAX < u;
63   |     ^^^^^^^^^^^^
64   |
65   = help: because `u32::MAX` is the maximum value for this type, this comparison is always false
66
67error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
68  --> $DIR/absurd-extreme-comparisons.rs:30:5
69   |
70LL |     u32::MAX <= u;
71   |     ^^^^^^^^^^^^^
72   |
73   = help: because `u32::MAX` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u32::MAX == u` instead
74
75error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
76  --> $DIR/absurd-extreme-comparisons.rs:32:5
77   |
78LL |     1-1 > u;
79   |     ^^^^^^^
80   |
81   = help: because `1-1` is the minimum value for this type, this comparison is always false
82
83error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
84  --> $DIR/absurd-extreme-comparisons.rs:34:5
85   |
86LL |     u >= !0;
87   |     ^^^^^^^
88   |
89   = help: because `!0` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u == !0` instead
90
91error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
92  --> $DIR/absurd-extreme-comparisons.rs:36:5
93   |
94LL |     u <= 12 - 2*6;
95   |     ^^^^^^^^^^^^^
96   |
97   = help: because `12 - 2*6` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == 12 - 2*6` instead
98
99error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
100  --> $DIR/absurd-extreme-comparisons.rs:39:5
101   |
102LL |     i < -127 - 1;
103   |     ^^^^^^^^^^^^
104   |
105   = help: because `-127 - 1` is the minimum value for this type, this comparison is always false
106
107error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
108  --> $DIR/absurd-extreme-comparisons.rs:41:5
109   |
110LL |     i8::MAX >= i;
111   |     ^^^^^^^^^^^^
112   |
113   = help: because `i8::MAX` is the maximum value for this type, this comparison is always true
114
115error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
116  --> $DIR/absurd-extreme-comparisons.rs:43:5
117   |
118LL |     3-7 < i32::MIN;
119   |     ^^^^^^^^^^^^^^
120   |
121   = help: because `i32::MIN` is the minimum value for this type, this comparison is always false
122
123error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
124  --> $DIR/absurd-extreme-comparisons.rs:46:5
125   |
126LL |     b >= true;
127   |     ^^^^^^^^^
128   |
129   = help: because `true` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `b == true` instead
130
131error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
132  --> $DIR/absurd-extreme-comparisons.rs:48:5
133   |
134LL |     false > b;
135   |     ^^^^^^^^^
136   |
137   = help: because `false` is the minimum value for this type, this comparison is always false
138
139error: <-comparison of unit values detected. This will always be false
140  --> $DIR/absurd-extreme-comparisons.rs:52:5
141   |
142LL |     () < {};
143   |     ^^^^^^^
144   |
145   = note: `#[deny(clippy::unit_cmp)]` on by default
146
147error: aborting due to 18 previous errors
148