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
birkenfeld opened this issue
Oct 14, 2018
· 3 comments
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.T-langRelevant to the language team, which will review and decide on the PR/issue.
I would argue that this shouldn't trigger the lint, since it isn't triggered either when there is no default impl. The argument name has two roles here, one of which the lint doesn't consider.
The text was updated successfully, but these errors were encountered:
birkenfeld
changed the title
Function arguments in trait functions are "unused" considering default impl
Function arguments in trait functions are "unused" if unused in default impl
Oct 14, 2018
estebank
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
labels
Aug 5, 2019
warning: unused variable: `id`
--> file5.rs:2:13
|
2 | fn frob(id: usize) -> Option<usize> { None }
| ^^ help: consider prefixing with an underscore: `_id`
|
= note: `#[warn(unused_variables)]` on by default
As per #26487 (comment), this is not something we would like to change, but I'll let @rust-lang/lang decide whether that is still the case and close, or prioritize.
I'm a bit conflicted but ultimately I agree with the prior consensus. It seems to me nothing has changed from before and that #[allow(...)] (enhanced by #60406) or let _ = id; works.
fmease
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
and removed
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
labels
Dec 21, 2024
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.T-langRelevant to the language team, which will review and decide on the PR/issue.
E.g.
triggers "unused variable: id".
I would argue that this shouldn't trigger the lint, since it isn't triggered either when there is no default impl. The argument name has two roles here, one of which the lint doesn't consider.
The text was updated successfully, but these errors were encountered: