diagnostic codes / Warnings
E0601 unused-binding
A binding is never read.
E0601unused-bindingprefix with _ to mute
| severity | warn |
|---|---|
| band | Warnings |
| in the v0 bootstrap | reserved — not emitted yet |
| explain | ralt explain E0601 |
The warning table reserves a code for a local that is declared and never used. The intended mute is an underscore prefix, which is how other languages in this family signal an intentionally ignored binding.
Not emitted by the v0 bootstrap
Not emitted in v0. An unused local checks clean, and `let _unused = 1;` is also accepted. There is no liveness pass to raise the warning yet.
What it looks like
e0601.tp
use tier core; fn main() -> i32 { let unused = 1; return 0; }
ralt check e0601.tp echo $? 0
What to do
- Remove the binding, or prefix it with `_` once the pass exists.
- A warning never changes the exit code; a build with only warnings exits 0.
Why the code exists
An unused local is usually the residue of a deleted feature or a typo in a name. It is a warning rather than an error because code in progress is allowed to have them.
What ralt explain says
ralt explain E0601 E0601 severity: warn name: unused-binding hint: prefix with _ to mute
Related
- Diagnostic codes /docs/diagnostics