External Publication
Visit Post

Pre-RFC: Deprecation and separation of the dead_code lint

Rust Internals [Unofficial] March 1, 2026
Source

Apersoma:

For existing Rust programmers: The dead_code lint is now deprecated, each of the different items it covered have their own lints now so if you have a dead struct you'd use an #expect(unused_data_structures)] to expect that instead of dead_code. The exact list can be found [here. (The dead code lint docs would be updated to have a table with each thing covered and what now covers that).

This seems like a terrible user experience IMO. I would be strongly opposed to deprecating the existing dead_code. For one, because of churn. And for two, because it's extremely useful as a way to silence all dead code warnings. Which I often do during development. I don't want to have to go through and select the right lints to silence.

Discussion in the ATmosphere

Loading comments...