Open
Open
Feature Request
Description
Code
fn func(u32: u32) {
println!("{u32}");
}
fn main() {
let u32 = 42;
func(u32);
let closure = |str: &str| {
println!("{}", str.len());
};
closure("hello");
}
Current output
(none)
Desired output
warning: variable `u32` should use a name that doesn't conflict with a standard type
--> src/main.rs:1:9
|
1 | fn func(u32: u32) {
| ^^^ help: rename the identifier
Rationale and extra context
It's confusing to read code where str
(or another standard type name) is used as an identifier. It also produces misleading syntax highlighting.
Other cases
Rust Version
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1
Anything else?
No response