Closed
Description
Code
fn main() {
let width = 10;
// ...
for _ in 0..w {
}
}
Current output
error[E0425]: cannot find value `w` in this scope
--> src/main.rs:4:17
|
4 | for _ in 0..w {
| ^ not found in this scope
|
help: you might have meant to write `.` instead of `..`
|
4 - for _ in 0..w {
4 + for _ in 0.w {
|
Desired output
error[E0425]: cannot find value `w` in this scope
--> src/main.rs:4:17
|
4 | for _ in 0..w {
| ^ not found in this scope
|
Rationale and extra context
Since integer literals do not have fields, it's odd to suggest field access.
It just confuses the user, rather than helping.
Other cases
No response
Rust Version
rustc 1.83.0-nightly (6f4ae0f34 2024-10-08)
binary: rustc
commit-hash: 6f4ae0f34503601e54680a137c1db0b81b56cc3d
commit-date: 2024-10-08
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.1
Anything else?
No response