@@ -4,9 +4,10 @@ error: struct is never constructed: `Bar`
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
+ = note: The leading underscore signals to the reader that while the struct may not be constructed
8
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
9
+ (e.g. some values are used for their effect when dropped or used in FFI code
10
+ exclusively through raw pointers)
10
11
note: the lint level is defined here
11
12
--> $DIR/lint-dead-code-1.rs:5:9
12
13
|
@@ -19,89 +20,98 @@ error: static is never used: `priv_static`
19
20
LL | static priv_static: isize = 0;
20
21
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_static`
21
22
|
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)
23
+ = note: The leading underscore signals to the reader that while the static may not be used
24
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
25
+ (e.g. some values are used for their effect when dropped or used in FFI code
26
+ exclusively through raw pointers)
25
27
26
28
error: constant is never used: `priv_const`
27
29
--> $DIR/lint-dead-code-1.rs:27:1
28
30
|
29
31
LL | const priv_const: isize = 0;
30
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_const`
31
33
|
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)
34
+ = note: The leading underscore signals to the reader that while the constant may not be used
35
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
36
+ (e.g. some values are used for their effect when dropped or used in FFI code
37
+ exclusively through raw pointers)
35
38
36
39
error: struct is never constructed: `PrivStruct`
37
40
--> $DIR/lint-dead-code-1.rs:35:8
38
41
|
39
42
LL | struct PrivStruct;
40
43
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_PrivStruct`
41
44
|
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)
45
+ = note: The leading underscore signals to the reader that while the struct may not be constructed
46
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
47
+ (e.g. some values are used for their effect when dropped or used in FFI code
48
+ exclusively through raw pointers)
45
49
46
50
error: enum is never used: `priv_enum`
47
51
--> $DIR/lint-dead-code-1.rs:64:6
48
52
|
49
53
LL | enum priv_enum { foo2, bar2 }
50
54
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_enum`
51
55
|
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)
56
+ = note: The leading underscore signals to the reader that while the enum may not be used
57
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
58
+ (e.g. some values are used for their effect when dropped or used in FFI code
59
+ exclusively through raw pointers)
55
60
56
61
error: variant is never constructed: `bar3`
57
62
--> $DIR/lint-dead-code-1.rs:67:5
58
63
|
59
64
LL | bar3
60
65
| ^^^^ help: if this is intentional, prefix it with an underscore: `_bar3`
61
66
|
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)
67
+ = note: The leading underscore signals to the reader that while the variant may not be constructed
68
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
69
+ (e.g. some values are used for their effect when dropped or used in FFI code
70
+ exclusively through raw pointers)
65
71
66
72
error: function is never used: `priv_fn`
67
73
--> $DIR/lint-dead-code-1.rs:88:4
68
74
|
69
75
LL | fn priv_fn() {
70
76
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_priv_fn`
71
77
|
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)
78
+ = note: The leading underscore signals to the reader that while the function may not be used
79
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
80
+ (e.g. some values are used for their effect when dropped or used in FFI code
81
+ exclusively through raw pointers)
75
82
76
83
error: function is never used: `foo`
77
84
--> $DIR/lint-dead-code-1.rs:93:4
78
85
|
79
86
LL | fn foo() {
80
87
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
81
88
|
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)
89
+ = note: The leading underscore signals to the reader that while the function may not be used
90
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
91
+ (e.g. some values are used for their effect when dropped or used in FFI code
92
+ exclusively through raw pointers)
85
93
86
94
error: function is never used: `bar`
87
95
--> $DIR/lint-dead-code-1.rs:98:4
88
96
|
89
97
LL | fn bar() {
90
98
| ^^^ help: if this is intentional, prefix it with an underscore: `_bar`
91
99
|
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)
100
+ = note: The leading underscore signals to the reader that while the function may not be used
101
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
102
+ (e.g. some values are used for their effect when dropped or used in FFI code
103
+ exclusively through raw pointers)
95
104
96
105
error: function is never used: `baz`
97
106
--> $DIR/lint-dead-code-1.rs:102:4
98
107
|
99
108
LL | fn baz() -> impl Copy {
100
109
| ^^^ help: if this is intentional, prefix it with an underscore: `_baz`
101
110
|
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)
111
+ = note: The leading underscore signals to the reader that while the function may not be used
112
+ by any Rust code, it still serves some other purpose that isn't detected by rustc.
113
+ (e.g. some values are used for their effect when dropped or used in FFI code
114
+ exclusively through raw pointers)
105
115
106
116
error: aborting due to 10 previous errors
107
117
0 commit comments