fork/rust

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

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

master
4.1 KiB131 linesraw
1error: manual `Range::contains` implementation
2  --> $DIR/range_contains.rs:13:5
3   |
4LL |     x >= 8 && x < 12;
5   |     ^^^^^^^^^^^^^^^^ help: use: `(8..12).contains(&x)`
6   |
7   = note: `-D clippy::manual-range-contains` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::manual_range_contains)]`
9
10error: manual `Range::contains` implementation
11  --> $DIR/range_contains.rs:14:5
12   |
13LL |     x < 42 && x >= 21;
14   |     ^^^^^^^^^^^^^^^^^ help: use: `(21..42).contains(&x)`
15
16error: manual `Range::contains` implementation
17  --> $DIR/range_contains.rs:15:5
18   |
19LL |     100 > x && 1 <= x;
20   |     ^^^^^^^^^^^^^^^^^ help: use: `(1..100).contains(&x)`
21
22error: manual `RangeInclusive::contains` implementation
23  --> $DIR/range_contains.rs:18:5
24   |
25LL |     x >= 9 && x <= 99;
26   |     ^^^^^^^^^^^^^^^^^ help: use: `(9..=99).contains(&x)`
27
28error: manual `RangeInclusive::contains` implementation
29  --> $DIR/range_contains.rs:19:5
30   |
31LL |     x <= 33 && x >= 1;
32   |     ^^^^^^^^^^^^^^^^^ help: use: `(1..=33).contains(&x)`
33
34error: manual `RangeInclusive::contains` implementation
35  --> $DIR/range_contains.rs:20:5
36   |
37LL |     999 >= x && 1 <= x;
38   |     ^^^^^^^^^^^^^^^^^^ help: use: `(1..=999).contains(&x)`
39
40error: manual `!Range::contains` implementation
41  --> $DIR/range_contains.rs:23:5
42   |
43LL |     x < 8 || x >= 12;
44   |     ^^^^^^^^^^^^^^^^ help: use: `!(8..12).contains(&x)`
45
46error: manual `!Range::contains` implementation
47  --> $DIR/range_contains.rs:24:5
48   |
49LL |     x >= 42 || x < 21;
50   |     ^^^^^^^^^^^^^^^^^ help: use: `!(21..42).contains(&x)`
51
52error: manual `!Range::contains` implementation
53  --> $DIR/range_contains.rs:25:5
54   |
55LL |     100 <= x || 1 > x;
56   |     ^^^^^^^^^^^^^^^^^ help: use: `!(1..100).contains(&x)`
57
58error: manual `!RangeInclusive::contains` implementation
59  --> $DIR/range_contains.rs:28:5
60   |
61LL |     x < 9 || x > 99;
62   |     ^^^^^^^^^^^^^^^ help: use: `!(9..=99).contains(&x)`
63
64error: manual `!RangeInclusive::contains` implementation
65  --> $DIR/range_contains.rs:29:5
66   |
67LL |     x > 33 || x < 1;
68   |     ^^^^^^^^^^^^^^^ help: use: `!(1..=33).contains(&x)`
69
70error: manual `!RangeInclusive::contains` implementation
71  --> $DIR/range_contains.rs:30:5
72   |
73LL |     999 < x || 1 > x;
74   |     ^^^^^^^^^^^^^^^^ help: use: `!(1..=999).contains(&x)`
75
76error: manual `Range::contains` implementation
77  --> $DIR/range_contains.rs:45:5
78   |
79LL |     y >= 0. && y < 1.;
80   |     ^^^^^^^^^^^^^^^^^ help: use: `(0. ..1.).contains(&y)`
81
82error: manual `!RangeInclusive::contains` implementation
83  --> $DIR/range_contains.rs:46:5
84   |
85LL |     y < 0. || y > 1.;
86   |     ^^^^^^^^^^^^^^^^ help: use: `!(0. ..=1.).contains(&y)`
87
88error: manual `RangeInclusive::contains` implementation
89  --> $DIR/range_contains.rs:49:5
90   |
91LL |     x >= -10 && x <= 10;
92   |     ^^^^^^^^^^^^^^^^^^^ help: use: `(-10..=10).contains(&x)`
93
94error: manual `RangeInclusive::contains` implementation
95  --> $DIR/range_contains.rs:51:5
96   |
97LL |     y >= -3. && y <= 3.;
98   |     ^^^^^^^^^^^^^^^^^^^ help: use: `(-3. ..=3.).contains(&y)`
99
100error: manual `RangeInclusive::contains` implementation
101  --> $DIR/range_contains.rs:56:30
102   |
103LL |     (x >= 0) && (x <= 10) && (z >= 0) && (z <= 10);
104   |                              ^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..=10).contains(&z)`
105
106error: manual `RangeInclusive::contains` implementation
107  --> $DIR/range_contains.rs:56:5
108   |
109LL |     (x >= 0) && (x <= 10) && (z >= 0) && (z <= 10);
110   |     ^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..=10).contains(&x)`
111
112error: manual `!Range::contains` implementation
113  --> $DIR/range_contains.rs:57:29
114   |
115LL |     (x < 0) || (x >= 10) || (z < 0) || (z >= 10);
116   |                             ^^^^^^^^^^^^^^^^^^^^ help: use: `!(0..10).contains(&z)`
117
118error: manual `!Range::contains` implementation
119  --> $DIR/range_contains.rs:57:5
120   |
121LL |     (x < 0) || (x >= 10) || (z < 0) || (z >= 10);
122   |     ^^^^^^^^^^^^^^^^^^^^ help: use: `!(0..10).contains(&x)`
123
124error: manual `Range::contains` implementation
125  --> $DIR/range_contains.rs:76:5
126   |
127LL |     x >= 8 && x < 35;
128   |     ^^^^^^^^^^^^^^^^ help: use: `(8..35).contains(&x)`
129
130error: aborting due to 21 previous errors
131