E0425name-resolution

Cannot find value in this scope

Referenced a name that isn't bound — typo, missing import, or out-of-scope variable.

Repro

fn main() {
    println!("{}", widht);   // E0425: cannot find value `widht` in this scope
}

Why

The compiler walks the lexical scope chain looking for a binding. Common causes: - Typo (widht vs width) - Forgot to bring a const/static into scope (use crate::config::WIDTH) - Used a binding declared after the use site - Tried to use a method or pattern as a value

Fix

- Check spelling first — the compiler often shows the closest match in its hint. - Add the missing use statement. - Move the binding above its use site, or let it inside the right scope. - For struct fields, prefix with self. inside methods.

Patterns that solve this