E0201: Undefined variable
| Code | Category | Stability |
|---|---|---|
E0201 | Semantic | Permanent |
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
}