1
1
error: item `PubOne` has a public `len` method but no corresponding `is_empty` method
2
- --> $DIR/len_zero.rs:10:5
2
+ --> $DIR/len_zero.rs:9:1
3
3
|
4
- 10 | pub fn len(self: &Self) -> isize {
5
- | _____^ starting here...
4
+ 9 | impl PubOne {
5
+ | _^ starting here...
6
+ 10 | | pub fn len(self: &Self) -> isize {
6
7
11 | | 1
7
8
12 | | }
8
- | |_____^ ...ending here
9
+ 13 | | }
10
+ | |_^ ...ending here
9
11
|
10
12
note: lint level defined here
11
13
--> $DIR/len_zero.rs:4:9
@@ -14,33 +16,48 @@ note: lint level defined here
14
16
| ^^^^^^^^^^^^^^^^^^^^
15
17
16
18
error: trait `PubTraitsToo` has a `len` method but no `is_empty` method
17
- --> $DIR/len_zero.rs:32:5
19
+ --> $DIR/len_zero.rs:55:1
18
20
|
19
- 32 | fn len(self: &Self) -> isize;
20
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
+ 55 | pub trait PubTraitsToo {
22
+ | _^ starting here...
23
+ 56 | | fn len(self: &Self) -> isize;
24
+ 57 | | }
25
+ | |_^ ...ending here
21
26
22
27
error: item `HasIsEmpty` has a public `len` method but a private `is_empty` method
23
- --> $DIR/len_zero.rs:66:5
28
+ --> $DIR/len_zero.rs:89:1
24
29
|
25
- 66 | pub fn len(self: &Self) -> isize {
26
- | _____^ starting here...
27
- 67 | | 1
28
- 68 | | }
29
- | |_____^ ...ending here
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
30
41
31
42
error: item `HasWrongIsEmpty` has a public `len` method but no corresponding `is_empty` method
32
- --> $DIR/len_zero.rs:95:5
33
- |
34
- 95 | pub fn len(self: &Self) -> isize {
35
- | _____^ starting here...
36
- 96 | | 1
37
- 97 | | }
38
- | |_____^ ...ending here
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
39
56
40
57
error: length comparison to zero
41
- --> $DIR/len_zero.rs:106 :8
58
+ --> $DIR/len_zero.rs:130 :8
42
59
|
43
- 106 | if x.len() == 0 {
60
+ 130 | if x.len() == 0 {
44
61
| ^^^^^^^^^^^^
45
62
|
46
63
note: lint level defined here
@@ -52,45 +69,45 @@ help: consider using `is_empty`
52
69
| if x.is_empty() {
53
70
54
71
error: length comparison to zero
55
- --> $DIR/len_zero.rs:113 :8
72
+ --> $DIR/len_zero.rs:137 :8
56
73
|
57
- 113 | if "".len() == 0 {
74
+ 137 | if "".len() == 0 {
58
75
| ^^^^^^^^^^^^^
59
76
|
60
77
help: consider using `is_empty`
61
78
| if "".is_empty() {
62
79
63
80
error: length comparison to zero
64
- --> $DIR/len_zero.rs:130 :8
81
+ --> $DIR/len_zero.rs:154 :8
65
82
|
66
- 130 | if has_is_empty.len() == 0 {
83
+ 154 | if has_is_empty.len() == 0 {
67
84
| ^^^^^^^^^^^^^^^^^^^^^^^
68
85
|
69
86
help: consider using `is_empty`
70
87
| if has_is_empty.is_empty() {
71
88
72
89
error: length comparison to zero
73
- --> $DIR/len_zero.rs:136 :8
90
+ --> $DIR/len_zero.rs:160 :8
74
91
|
75
- 136 | if has_is_empty.len() != 0 {
92
+ 160 | if has_is_empty.len() != 0 {
76
93
| ^^^^^^^^^^^^^^^^^^^^^^^
77
94
|
78
95
help: consider using `is_empty`
79
96
| if !has_is_empty.is_empty() {
80
97
81
98
error: length comparison to zero
82
- --> $DIR/len_zero.rs:142 :8
99
+ --> $DIR/len_zero.rs:166 :8
83
100
|
84
- 142 | if has_is_empty.len() > 0 {
101
+ 166 | if has_is_empty.len() > 0 {
85
102
| ^^^^^^^^^^^^^^^^^^^^^^
86
103
|
87
104
help: consider using `is_empty`
88
105
| if !has_is_empty.is_empty() {
89
106
90
107
error: length comparison to zero
91
- --> $DIR/len_zero.rs:151 :8
108
+ --> $DIR/len_zero.rs:175 :8
92
109
|
93
- 151 | if with_is_empty.len() == 0 {
110
+ 175 | if with_is_empty.len() == 0 {
94
111
| ^^^^^^^^^^^^^^^^^^^^^^^^
95
112
|
96
113
help: consider using `is_empty`
0 commit comments