diagnostic codes / Tiers
E0301 tier-violation
A feature needs a higher tier than the file declares.
| severity | error |
|---|---|
| band | Tiers |
| in the v0 bootstrap | reserved — not emitted yet |
| explain | ralt explain E0301 |
The tier system is a compile-time ceiling. A file that declares `use tier kernel` may not call a builtin, allocate, or use a construct that the kernel tier does not carry; reaching past the ceiling is meant to be a hard error, never a runtime surprise.
Not enforced in the v0 bootstrap. The tier checker is not wired: a kernel-tier file that uses `opt`, `match`, or `print_str` checks clean, and no input produces E0301 today. The tier declarations are parsed and recorded, and the pass is on the roadmap.
What it looks like
use tier kernel; fn main() -> i32 { let o: opt<i32> = some(1); return 0; }
ralt check e0301.tp echo $? 0
This is the pass that is not there yet. The program above should be refused once the tier pass lands; today it is accepted, and the docs say so rather than pretend otherwise.
What to do
- Raise the declared tier: `use tier core;` or higher.
- Or remove the feature the tier cannot carry.
- There is no pragma to silence the check; the declaration is the decision.
Why the code exists
On a microcontroller, a runtime you did not budget for is not a style problem. A ceiling that fails the build is the only version of that promise that can be checked before flashing.
What ralt explain says
ralt explain E0301 E0301 severity: error name: tier-violation hint: feature requires a higher tier; raise the tier target or rewrite the call
Related
- Tiers /docs/language/tiers