]> git.lizzy.rs Git - rust.git/blob - tests/ui/len_zero.stderr
Merge branch 'master' into 1537-drop_copy
[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:9:1
3    |
4 9  |   impl PubOne {
5    |  _^ starting here...
6 10 | |     pub fn len(self: &Self) -> isize {
7 11 | |         1
8 12 | |     }
9 13 | | }
10    | |_^ ...ending here
11    |
12 note: lint level defined here
13   --> $DIR/len_zero.rs:4:9
14    |
15 4  | #![deny(len_without_is_empty, len_zero)]
16    |         ^^^^^^^^^^^^^^^^^^^^
17
18 error: trait `PubTraitsToo` has a `len` method but no `is_empty` method
19   --> $DIR/len_zero.rs:55:1
20    |
21 55 |   pub trait PubTraitsToo {
22    |  _^ starting here...
23 56 | |     fn len(self: &Self) -> isize;
24 57 | | }
25    | |_^ ...ending here
26
27 error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method
28   --> $DIR/len_zero.rs:89:1
29    |
30 89 |   impl HasIsEmpty {
31    |  _^ starting here...
32 90 | |     pub fn len(self: &Self) -> isize {
33 91 | |         1
34 92 | |     }
35 93 | |
36 94 | |     fn is_empty(self: &Self) -> bool {
37 95 | |         false
38 96 | |     }
39 97 | | }
40    | |_^ ...ending here
41
42 error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method
43    --> $DIR/len_zero.rs:118:1
44     |
45 118 |   impl HasWrongIsEmpty {
46     |  _^ starting here...
47 119 | |     pub fn len(self: &Self) -> isize {
48 120 | |         1
49 121 | |     }
50 122 | |
51 123 | |     pub fn is_empty(self: &Self, x : u32) -> bool {
52 124 | |         false
53 125 | |     }
54 126 | | }
55     | |_^ ...ending here
56
57 error: length comparison to zero
58    --> $DIR/len_zero.rs:130:8
59     |
60 130 |     if x.len() == 0 {
61     |        ^^^^^^^^^^^^
62     |
63 note: lint level defined here
64    --> $DIR/len_zero.rs:4:31
65     |
66 4   | #![deny(len_without_is_empty, len_zero)]
67     |                               ^^^^^^^^
68 help: consider using `is_empty`
69     |     if x.is_empty() {
70
71 error: length comparison to zero
72    --> $DIR/len_zero.rs:137:8
73     |
74 137 |     if "".len() == 0 {
75     |        ^^^^^^^^^^^^^
76     |
77 help: consider using `is_empty`
78     |     if "".is_empty() {
79
80 error: length comparison to zero
81    --> $DIR/len_zero.rs:154:8
82     |
83 154 |     if has_is_empty.len() == 0 {
84     |        ^^^^^^^^^^^^^^^^^^^^^^^
85     |
86 help: consider using `is_empty`
87     |     if has_is_empty.is_empty() {
88
89 error: length comparison to zero
90    --> $DIR/len_zero.rs:160:8
91     |
92 160 |     if has_is_empty.len() != 0 {
93     |        ^^^^^^^^^^^^^^^^^^^^^^^
94     |
95 help: consider using `is_empty`
96     |     if !has_is_empty.is_empty() {
97
98 error: length comparison to zero
99    --> $DIR/len_zero.rs:166:8
100     |
101 166 |     if has_is_empty.len() > 0 {
102     |        ^^^^^^^^^^^^^^^^^^^^^^
103     |
104 help: consider using `is_empty`
105     |     if !has_is_empty.is_empty() {
106
107 error: length comparison to zero
108    --> $DIR/len_zero.rs:175:8
109     |
110 175 |     if with_is_empty.len() == 0 {
111     |        ^^^^^^^^^^^^^^^^^^^^^^^^
112     |
113 help: consider using `is_empty`
114     |     if with_is_empty.is_empty() {
115
116 error: length comparison to zero
117    --> $DIR/len_zero.rs:190:8
118     |
119 190 |     if b.len() != 0 {
120     |        ^^^^^^^^^^^^
121     |
122 help: consider using `is_empty`
123     |     if !b.is_empty() {
124
125 error: aborting due to 11 previous errors
126