-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unused-lifetimes
lint duplicates "parameter is never used" error
#72587
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Aaron1011
added
C-bug
Category: This is a bug.
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
labels
May 25, 2020
jonas-schievink
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
May 25, 2020
Note that this lint still makes sense for functions: #![warn(unused_lifetimes)]
fn unused_lifetime<'a>() {}
fn main() {unused_lifetime();}
But then running clippy on the following looks dumb (the lints are redundant): #![warn(unused_lifetimes)]
#![warn(clippy::extra_unused_lifetimes)]
fn unused_lifetime<'a>() {}
fn main() {
unused_lifetime();
}
I don't really know the compiler internals, but should this lint just skip structs ? (is that even possible ?) |
5 tasks
rustbot
added
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
Jan 25, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 9, 2024
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Mar 10, 2024
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 10, 2024
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 10, 2024
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Mar 10, 2024
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 10, 2024
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 10, 2024
Rollup merge of rust-lang#122251 - jieyouxu:unused-lifetimes-dedup-test, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code:
gives the following output:
The "unused lifetimes" warning is redundant - not using a lifetime parameter is a hard error, so the warning gives no additional information.
The text was updated successfully, but these errors were encountered: