E3038

E3038 — type Item = .. in an impl whose trait declares no Item. Usually a misspelling: nothing reads the binding, so it would go on meaning nothing, in silence.

What the compiler reports

E3038 … binds 'Itm', which trait Counter does not declare

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

trait Counter {
  type Item;
  fn next(self : Self) -> Self::Item;
}

impl Counter for i32 {
  type Itm = i64;
  fn next(self : i32) -> i64 {
    return 7;
  }
}

fn main() -> i32 {
  let a : i32 = 1;
  print(a.next());
  return 0;
}

// A misspelling reports both halves: the name that was not bound, and the one that was bound
// and means nothing.

From tests/frontend/fail/associated_type_not_declared.vx, which asserts this diagnostic on every commit.

Related