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
Currently, any code which is not reachable is considered dead and warned about, even if there are references to it from other dead code. Thus if I implement a tree of functions/methods which call each other, but haven't yet implemented any code to actually call into it yet, every single function in the family will produce a dead code warning, not only the root functions that actually lack any textual references. This is annoyingly verbose.
As a comparison, Clang and GCC only produce warnings for the roots in the equivalent situation for C code.
The text was updated successfully, but these errors were encountered:
huonw
added
the
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
label
Oct 31, 2014
I find it very useful. It frequently finds graphs of genuinely dead code that either indicates a bug or allows for removing a bunch of obsolete code. In my opinion, the entire point of having this stuff as warnings instead of errors is so that it doesn't get in the way of development.
This is by design. I note that if you add #[allow(dead_code)] to the root, warnings are silenced for the entire tree. You do not need to add allow attributes to all of them.
Currently, any code which is not reachable is considered dead and warned about, even if there are references to it from other dead code. Thus if I implement a tree of functions/methods which call each other, but haven't yet implemented any code to actually call into it yet, every single function in the family will produce a dead code warning, not only the root functions that actually lack any textual references. This is annoyingly verbose.
As a comparison, Clang and GCC only produce warnings for the roots in the equivalent situation for C code.
The text was updated successfully, but these errors were encountered: