Closed
Description
The keyword_idents
lint seems to miss the lifetime in a few places. Example:
#![warn(keyword_idents)]
pub struct S<'gen>(pub &'gen i32);
pub trait Visit {
fn visit_path(&mut self) {}
}
impl<'gen> Visit for S<'gen> {}
The suggestions applied results in:
@@ -1,9 +1,9 @@
#![warn(keyword_idents)]
-pub struct S<'gen>(pub &'gen i32);
+pub struct S<'r#gen>(pub &'gen i32);
pub trait Visit {
fn visit_path(&mut self) {}
}
-impl<'gen> Visit for S<'gen> {}
+impl<'r#gen> Visit for S<'gen> {}
Notice that it missed the 'r#gen
update in the tuple struct definition, and the for S<'gen>
position. I have not audited to see what other scenarios it is missing.
Meta
rustc 1.85.0-nightly (c44b3d50f 2024-12-03)
binary: rustc
commit-hash: c44b3d50fea96a3e0417e8264c16ea21a0a3fca2
commit-date: 2024-12-03
host: aarch64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.4
Metadata
Metadata
Assignees
Labels
Area: The 2024 editionArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Suggestions generated by the compiler applied by `cargo fix`Category: This is a bug.Diagnostics: An error or lint that should account for edition differences.Lint group: keyword_identsLint: keyword_idents_2024Relevant to the compiler team, which will review and decide on the PR/issue.