rust/tests/ui/consts/issue-70942-trait-vs-impl-mismatch.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
228 B
Rust
Raw Normal View History

trait Nat {
const VALUE: usize;
}
struct Zero;
impl Nat for Zero {
const VALUE: i32 = 0;
//~^ ERROR implemented const `VALUE` has an incompatible type for trait
}
fn main() {
let _: [i32; Zero::VALUE] = [];
}