withstanding_crepe
withstanding_crepe

Reputation: 11

How to find code (eg functions) that is not referenced by any other code?

Every time I come back to rust I am baffled by how the warnings for unused code work, they're transitive! Even if function f is called from function g, f will still be considered unused if g is unused.

I'm sure this is very useful behavior for some circumstances but I find myself missing warnings for unused code found in the linters for other programming languages. When searching I found this post which perfectly describes my sentiment. To me warnings for dead code are important to identify work to do next and possible bugs, but the useful warnings are buried in a sea of spammy warnings of transitively unused code, not actually unused code.

Are there any configuration options or other tools I can use for identifying "real" unused code? Or am I looking at this in the wrong way?

I searched google trying to find previous relevant discussions or solutions and didn't find anything other than the previously mentioned post.

Upvotes: 1

Views: 103

Answers (0)

Related Questions