We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
extra_unused_lifetimes
extra_unused_lifetimes doesn't have an auto-fix for the unused lifetimes it flags, but it'd be nice if it did.
fn unused_lt<'a>(x: u8) {}
could become
fn unused_lt<>(x: u8) {}
which I've seen my editor change to
fn unused_lt(x: u8) {}
on save.
I've thought about widening the range of the lint so it changes
to
but that could become messy in the case with
fn unused_lt<'a, 'b, 'c, 'd>(x: u8) {}
so I think it's fine to just have the auto-fix remove the unused lifetime and have a formatter remove any stray <>.
<>
I've looked into this, and there's an edge case with
trait _Foo { fn hey(); } impl<'a, T: ?Sized> _Foo for &mut T { fn hey() {} }
since just removing 'a' results in
'a'
trait _Foo { fn hey(); } impl<, T: ?Sized> _Foo for &mut T { fn hey() {} }
and an error.
rustc 1.81.0 (eeb90cda1 2024-09-04) binary: rustc commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c commit-date: 2024-09-04 host: x86_64-unknown-linux-gnu release: 1.81.0 LLVM version: 18.1.7
@rustbot label +
The text was updated successfully, but these errors were encountered:
Error: Label can only be set by Rust team members
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.
Sorry, something went wrong.
No branches or pull requests
Description
extra_unused_lifetimes
doesn't have an auto-fix for the unused lifetimes it flags, but it'd be nice if it did.could become
which I've seen my editor change to
on save.
I've thought about widening the range of the lint so it changes
to
but that could become messy in the case with
so I think it's fine to just have the auto-fix remove the unused lifetime and have a formatter remove any stray
<>
.Edge Case
I've looked into this, and there's an edge case with
since just removing
'a'
results inand an error.
Version
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7
Additional Labels
@rustbot label +
The text was updated successfully, but these errors were encountered: