mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
15 lines
228 B
Rust
15 lines
228 B
Rust
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] = [];
|
|
}
|