E3040
E3040 —I::Itemwhere no impl for whatIis binds an associated type namedItem:Ihas no such bound, or the name is misspelled.
What the compiler reports
E3040 … `I::Itme` does not resolve, because no impl for `Range` binds an associated type named 'Itme'
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
import core::iter;
fn first<I : Iterator>(it : I) -> Option<I::Itme> {
let mut i = it;
return i.next();
}
fn main() -> i32 {
let v = first(range(0i64, 5i64));
return 0;
}
From tests/frontend/fail/projection_does_not_resolve.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.
E3039
I::Item disagrees with the impl for what I is: an argument bound it to one type and that impl binds Item to another.
E3041A struct field that names I::Item. Fields are laid out from the struct's parameters alone, so the projection is made a parameter instead, as Map<I, F> does with its closure.