]> git.lizzy.rs Git - rust.git/blob - tests/ui/len_zero.stderr
Auto merge of #3635 - matthiaskrgr:revert_random_state_3603, r=xfix
[rust.git] / tests / ui / len_zero.stderr
1 error: item `PubOne` has a public `len` method but no corresponding `is_empty` method
2   --> $DIR/len_zero.rs:15:1
3    |
4 LL | / impl PubOne {
5 LL | |     pub fn len(self: &Self) -> isize {
6 LL | |         1
7 LL | |     }
8 LL | | }
9    | |_^
10    |
11    = note: `-D clippy::len-without-is-empty` implied by `-D warnings`
12
13 error: trait `PubTraitsToo` has a `len` method but no (possibly inherited) `is_empty` method
14   --> $DIR/len_zero.rs:64:1
15    |
16 LL | / pub trait PubTraitsToo {
17 LL | |     fn len(self: &Self) -> isize;
18 LL | | }
19    | |_^
20
21 error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method
22   --> $DIR/len_zero.rs:98:1
23    |
24 LL | / impl HasIsEmpty {
25 LL | |     pub fn len(self: &Self) -> isize {
26 LL | |         1
27 LL | |     }
28 ...  |
29 LL | |     }
30 LL | | }
31    | |_^
32
33 error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method
34   --> $DIR/len_zero.rs:127:1
35    |
36 LL | / impl HasWrongIsEmpty {
37 LL | |     pub fn len(self: &Self) -> isize {
38 LL | |         1
39 LL | |     }
40 ...  |
41 LL | |     }
42 LL | | }
43    | |_^
44
45 error: length comparison to zero
46   --> $DIR/len_zero.rs:148:8
47    |
48 LL |     if x.len() == 0 {
49    |        ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `x.is_empty()`
50    |
51    = note: `-D clippy::len-zero` implied by `-D warnings`
52
53 error: length comparison to zero
54   --> $DIR/len_zero.rs:152:8
55    |
56 LL |     if "".len() == 0 {}
57    |        ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `"".is_empty()`
58
59 error: length comparison to zero
60   --> $DIR/len_zero.rs:167:8
61    |
62 LL |     if has_is_empty.len() == 0 {
63    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
64
65 error: length comparison to zero
66   --> $DIR/len_zero.rs:170:8
67    |
68 LL |     if has_is_empty.len() != 0 {
69    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
70
71 error: length comparison to zero
72   --> $DIR/len_zero.rs:173:8
73    |
74 LL |     if has_is_empty.len() > 0 {
75    |        ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
76
77 error: length comparison to one
78   --> $DIR/len_zero.rs:176:8
79    |
80 LL |     if has_is_empty.len() < 1 {
81    |        ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
82
83 error: length comparison to one
84   --> $DIR/len_zero.rs:179:8
85    |
86 LL |     if has_is_empty.len() >= 1 {
87    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
88
89 error: length comparison to zero
90   --> $DIR/len_zero.rs:190:8
91    |
92 LL |     if 0 == has_is_empty.len() {
93    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
94
95 error: length comparison to zero
96   --> $DIR/len_zero.rs:193:8
97    |
98 LL |     if 0 != has_is_empty.len() {
99    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
100
101 error: length comparison to zero
102   --> $DIR/len_zero.rs:196:8
103    |
104 LL |     if 0 < has_is_empty.len() {
105    |        ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
106
107 error: length comparison to one
108   --> $DIR/len_zero.rs:199:8
109    |
110 LL |     if 1 <= has_is_empty.len() {
111    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
112
113 error: length comparison to one
114   --> $DIR/len_zero.rs:202:8
115    |
116 LL |     if 1 > has_is_empty.len() {
117    |        ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
118
119 error: length comparison to zero
120   --> $DIR/len_zero.rs:216:8
121    |
122 LL |     if with_is_empty.len() == 0 {
123    |        ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `with_is_empty.is_empty()`
124
125 error: length comparison to zero
126   --> $DIR/len_zero.rs:229:8
127    |
128 LL |     if b.len() != 0 {}
129    |        ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!b.is_empty()`
130
131 error: trait `DependsOnFoo` has a `len` method but no (possibly inherited) `is_empty` method
132   --> $DIR/len_zero.rs:235:1
133    |
134 LL | / pub trait DependsOnFoo: Foo {
135 LL | |     fn len(&mut self) -> usize;
136 LL | | }
137    | |_^
138
139 error: aborting due to 19 previous errors
140