Closed
Description
When encountering a binding that is not available
let foo = 1;
{
let bar = 2;
}
println!("{foo} {bar}");
the error should mention bindings that are outside of the scope but within the same item
error[E0425]: cannot find value `bar` in this scope
--> src/main.rs:6:22
|
6 | println!("{foo} {bar}");
| ^^^ not found in this scope
note: the binding `bar` is available in a different scope in the same function
--> src/main.rs:4:8
|
4 | let bar = 2;
| ^^^
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Name/path resolution done by `rustc_resolve` specificallyDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.