Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 355 Bytes

File metadata and controls

18 lines (13 loc) · 355 Bytes

An implementation of a trait doesn't match the type contraint.

Erroneous code example:

trait Foo {
    const BAR: bool;
}

struct Bar;

impl Foo for Bar {
    const BAR: u32 = 5; // error, expected bool, found u32
}

The types of any associated constants in a trait implementation must match the types in the trait definition.