Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E0201: Undefined variable

CodeCategoryStability
E0201SemanticPermanent

Explanation

Rue could not resolve a variable, constant, or enum type name used in an expression.

Likely cause

The name is misspelled, is outside its lexical scope, or belongs to another module and was used without that module's binding.

Examples

Undefined local

fn main() -> i32 {
    answer
}

Define the name before use

fn main() -> i32 {
    let answer = 42;
    answer
}

References