E3030
E3030 — An operator applied to operand types it is not defined on —%on a shaped tensor or on abool. Refused here because the alternative is worse in both directions: the flat emitter would decline and fall back to a path that cannot lower it either, and ani1operand would reacharith.remsiand verify.
What the compiler reports
E3030 … at 6:17 … `!` takes a bool or an integer, got f32
The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.
A program that triggers it
fn main() -> i32 {
let f : f32 = 1.5;
let g : f32 = !f;
return 0;
}
// A float has no bitwise complement, and Rust has no `!` on one. It used to type as a `bool`.
From tests/frontend/fail/not_on_a_float.vx, which asserts this diagnostic on every commit.
Related
A tour of VxThe chapter covering the rule this code enforces.
All diagnosticsEvery code the compiler can emit, grouped by stage.
E3029A type name in a signature that names no declaration. An unknown name in type position parses as a user nominal, so without this a typo — or a type constructor removed from the language — compiled silently and did nothing.
E3031
impl Copy for X where one of X's fields is a type that moves. Copy promises a value survives being assigned elsewhere, and a field that does not survive it breaks that promise for the whole type — which would be a way to duplicate a tensor, or any other placed value, without saying so.