You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve dead_code lint to detect unused structs which implement private traits #122361
error: struct `UnusedT1` is never constructed
--> src/main.rs:4:8
|
4 | struct UnusedT1;| ^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 |#![deny(dead_code)]| ^^^^^^^^^
error: could not compile `playground` (bin "playground") due to 1 previous error
Desired output
error: struct `UnusedT1` is never constructed
--> src/main.rs:4:8
|
4 | struct UnusedT1;| ^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 |#![deny(dead_code)]| ^^^^^^^^^
error: struct `UnusedT2` is never constructed
--> src/main.rs:5:8
|
5 | struct UnusedT2;| ^^^^^^^^
error: could not compile `playground` (bin "playground") due to 2 previous errors
Activity
mu001999 commentedon Mar 12, 2024
@rustbot claim
krtab commentedon Mar 12, 2024
Maybe you can get inspiration from #119552, especially if you end up having to fix previously undetected errors in multiple places in rustc.
mu001999 commentedon Mar 12, 2024
Thanks for your suggestion, but I think this just needs to extend #121752 ;)
Rollup merge of rust-lang#122382 - mu001999:dead_code/enhance, r=petr…
Unrolled build for rust-lang#122382