-
Notifications
You must be signed in to change notification settings - Fork 13k
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
we should lint on named lifetimes forced to be equal to another named lifetime #118376
Labels
A-lifetimes
Area: Lifetimes / regions
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Nov 27, 2023
lcnr
changed the title
lint on named lifetimes forced to be equal to another named lifetime
we should lint on named lifetimes forced to be equal to another named lifetime
Nov 27, 2023
Noratrieb
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-lifetimes
Area: Lifetimes / regions
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Nov 27, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 27, 2023
Extend `UNUSED_LIFETIMES` lint to detect lifetimes which are semantically redundant There already is a `UNUSED_LIFETIMES` lint which is fired when we detect where clause bounds like `where 'a: 'static`, however, it doesn't use the full power of lexical region resolution to detect failures. Right now `UNUSED_LIFETIMES` is an `Allow` lint, though presumably we could bump it to warn? I can (somewhat) easily implement a structured suggestion so this can be rustfix'd automatically, since we can just walk through the HIR body, replacing instances of the redundant lifetime. Fixes rust-lang#118376 r? lcnr
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 27, 2023
Extend `UNUSED_LIFETIMES` lint to detect lifetimes which are semantically redundant There already is a `UNUSED_LIFETIMES` lint which is fired when we detect where clause bounds like `where 'a: 'static`, however, it doesn't use the full power of lexical region resolution to detect failures. Right now `UNUSED_LIFETIMES` is an `Allow` lint, though presumably we could bump it to warn? I can (somewhat) easily implement a structured suggestion so this can be rustfix'd automatically, since we can just walk through the HIR body, replacing instances of the redundant lifetime. Fixes rust-lang#118376 r? lcnr
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 28, 2023
Extend `UNUSED_LIFETIMES` lint to detect lifetimes which are semantically redundant There already is a `UNUSED_LIFETIMES` lint which is fired when we detect where clause bounds like `where 'a: 'static`, however, it doesn't use the full power of lexical region resolution to detect failures. Right now `UNUSED_LIFETIMES` is an `Allow` lint, though presumably we could bump it to warn? I can (somewhat) easily implement a structured suggestion so this can be rustfix'd automatically, since we can just walk through the HIR body, replacing instances of the redundant lifetime. Fixes rust-lang#118376 r? lcnr
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 29, 2023
Extend `UNUSED_LIFETIMES` lint to detect lifetimes which are semantically redundant There already is a `UNUSED_LIFETIMES` lint which is fired when we detect where clause bounds like `where 'a: 'static`, however, it doesn't use the full power of lexical region resolution to detect failures. Right now `UNUSED_LIFETIMES` is an `Allow` lint, though presumably we could bump it to warn? I can (somewhat) easily implement a structured suggestion so this can be rustfix'd automatically, since we can just walk through the HIR body, replacing instances of the redundant lifetime. Fixes rust-lang#118376 r? lcnr
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 10, 2024
Rollup merge of rust-lang#118391 - compiler-errors:lifetimes-eq, r=lcnr Add `REDUNDANT_LIFETIMES` lint to detect lifetimes which are semantically redundant There already is a `UNUSED_LIFETIMES` lint which is fired when we detect where clause bounds like `where 'a: 'static`, however, it doesn't use the full power of lexical region resolution to detect failures. Right now `UNUSED_LIFETIMES` is an `Allow` lint, though presumably we could bump it to warn? I can (somewhat) easily implement a structured suggestion so this can be rustfix'd automatically, since we can just walk through the HIR body, replacing instances of the redundant lifetime. Fixes rust-lang#118376 r? lcnr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lifetimes
Area: Lifetimes / regions
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
and
and
and
these should all warn that the named lifetimes are equal to some other named lifetime and should be removed.
The text was updated successfully, but these errors were encountered: