E0265

A type that does not implement a trait it must: == and != need Eq; a call must satisfy the callee's bounds; a qualified call Trait.method(x) needs x's type to implement Trait; an interpolation hole needs Display. Spans the operator expression, the call, or the hole.

Machine-applicable fix: On a generic parameter of the enclosing function, add the bound.

Example

This program fails with E0265.

struct Point { x: Int }

fn main() {
    let a = Point(x: 1)
    let b = Point(x: 1)
    let same = a == b
}

Fixed

The same program, fixed.

struct Point { x: Int }

fn main() {
    let a = Point(x: 1)
    let b = Point(x: 1)
    let same = a.x == b.x
}

Listed in the checker notes. oskac explain E0265 prints this entry offline.

All error codes