Closed
Description
Currently a warning for an unused function returns a span of the entire function. As a consequence, RLS based IDE environments may then put green squiggles on the entire function. This makes it very annoying to work on a function, if you have not yet written the function that uses it.
There may be other unused warnings for structs/traits that could be similarly adjusted.
This issue has been assigned to @Quantumplation via this comment.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Diagnostics: An error or lint that needs small tweaks.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
sanxiyn commentedon Mar 12, 2019
Does it? For me warnings for unused functions only return span of function signatures, not bodies. Is that still annoying? Same for structs.
I think this is somewhat intentional as it is the item that is unused. Spanning the name usually means name resolution failure.
jackmott commentedon Mar 12, 2019
VSCode ends up highlighting the whole function, so if you are correct this bug should be closed and moved to that repo. How can we verify?
sanxiyn commentedon Mar 13, 2019
It would help if you could provide a test case that reproduces the bug, preferably in the following format:
estebank commentedon Aug 6, 2019
Some further details in duplicate #63064
estebank commentedon Oct 18, 2019
Still reproduces.
Quantumplation commentedon Oct 24, 2019
@rustbot claim
I'd like to pick this up as my first contribution. @jakubadamw had said (on the duplicate) that he intended to work on this, but it's been a few months, so I'm not sure if he's lost interest or not.
I started to work on this, and I figured first step would be to write a ui test for it. I notice that by now there's a few
dead-code
related tests. Is there a policy around moving tests to sub folders? If no one objects, I'd like to move all the dead-code related tests to a dead-code subfolder as part of this work as well.jackmott commentedon Oct 24, 2019
@Quantumplation I can't speak for the rust maintainers but generally it is greatly preferred to just have one thing per PR. I would do the test organization as a separate pr.
estebank commentedon Oct 24, 2019
@Quantumplation go for it, in separate commits in the same PR.
14 remaining items