@@ -2,8 +2,11 @@ error: struct is never constructed: `Bar`
2
2
--> $DIR/lint-dead-code-1.rs:12:16
3
3
|
4
4
LL | pub struct Bar;
5
- | ^^^
5
+ | ^^^ help: if this is intentional, prefix it with an underscore: `_Bar`
6
6
|
7
+ = note: the leading underscore helps signal to the reader that the struct may still serve
8
+ a purpose even if it isn't used in a way that we can detect (e.g. the struct
9
+ is only used through FFI or used only for its effect when dropped)
7
10
note: the lint level is defined here
8
11
--> $DIR/lint-dead-code-1.rs:5:9
9
12
|
@@ -14,55 +17,91 @@ error: static is never used: `priv_static`
14
17
--> $DIR/lint-dead-code-1.rs:20:1
15
18
|
16
19
LL | static priv_static: isize = 0;
17
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_static`
21
+ |
22
+ = note: the leading underscore helps signal to the reader that the static may still serve
23
+ a purpose even if it isn't used in a way that we can detect (e.g. the static
24
+ is only used through FFI or used only for its effect when dropped)
18
25
19
26
error: constant is never used: `priv_const`
20
27
--> $DIR/lint-dead-code-1.rs:27:1
21
28
|
22
29
LL | const priv_const: isize = 0;
23
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_const`
31
+ |
32
+ = note: the leading underscore helps signal to the reader that the constant may still serve
33
+ a purpose even if it isn't used in a way that we can detect (e.g. the constant
34
+ is only used through FFI or used only for its effect when dropped)
24
35
25
36
error: struct is never constructed: `PrivStruct`
26
37
--> $DIR/lint-dead-code-1.rs:35:8
27
38
|
28
39
LL | struct PrivStruct;
29
- | ^^^^^^^^^^
40
+ | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_PrivStruct`
41
+ |
42
+ = note: the leading underscore helps signal to the reader that the struct may still serve
43
+ a purpose even if it isn't used in a way that we can detect (e.g. the struct
44
+ is only used through FFI or used only for its effect when dropped)
30
45
31
46
error: enum is never used: `priv_enum`
32
47
--> $DIR/lint-dead-code-1.rs:64:6
33
48
|
34
49
LL | enum priv_enum { foo2, bar2 }
35
- | ^^^^^^^^^
50
+ | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_enum`
51
+ |
52
+ = note: the leading underscore helps signal to the reader that the enum may still serve
53
+ a purpose even if it isn't used in a way that we can detect (e.g. the enum
54
+ is only used through FFI or used only for its effect when dropped)
36
55
37
56
error: variant is never constructed: `bar3`
38
57
--> $DIR/lint-dead-code-1.rs:67:5
39
58
|
40
59
LL | bar3
41
- | ^^^^
60
+ | ^^^^ help: if this is intentional, prefix it with an underscore: `_bar3`
61
+ |
62
+ = note: the leading underscore helps signal to the reader that the variant may still serve
63
+ a purpose even if it isn't used in a way that we can detect (e.g. the variant
64
+ is only used through FFI or used only for its effect when dropped)
42
65
43
66
error: function is never used: `priv_fn`
44
67
--> $DIR/lint-dead-code-1.rs:88:4
45
68
|
46
69
LL | fn priv_fn() {
47
- | ^^^^^^^
70
+ | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_fn`
71
+ |
72
+ = note: the leading underscore helps signal to the reader that the function may still serve
73
+ a purpose even if it isn't used in a way that we can detect (e.g. the function
74
+ is only used through FFI or used only for its effect when dropped)
48
75
49
76
error: function is never used: `foo`
50
77
--> $DIR/lint-dead-code-1.rs:93:4
51
78
|
52
79
LL | fn foo() {
53
- | ^^^
80
+ | ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
81
+ |
82
+ = note: the leading underscore helps signal to the reader that the function may still serve
83
+ a purpose even if it isn't used in a way that we can detect (e.g. the function
84
+ is only used through FFI or used only for its effect when dropped)
54
85
55
86
error: function is never used: `bar`
56
87
--> $DIR/lint-dead-code-1.rs:98:4
57
88
|
58
89
LL | fn bar() {
59
- | ^^^
90
+ | ^^^ help: if this is intentional, prefix it with an underscore: `_bar`
91
+ |
92
+ = note: the leading underscore helps signal to the reader that the function may still serve
93
+ a purpose even if it isn't used in a way that we can detect (e.g. the function
94
+ is only used through FFI or used only for its effect when dropped)
60
95
61
96
error: function is never used: `baz`
62
97
--> $DIR/lint-dead-code-1.rs:102:4
63
98
|
64
99
LL | fn baz() -> impl Copy {
65
- | ^^^
100
+ | ^^^ help: if this is intentional, prefix it with an underscore: `_baz`
101
+ |
102
+ = note: the leading underscore helps signal to the reader that the function may still serve
103
+ a purpose even if it isn't used in a way that we can detect (e.g. the function
104
+ is only used through FFI or used only for its effect when dropped)
66
105
67
106
error: aborting due to 10 previous errors
68
107
0 commit comments