mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
19 lines
239 B
Rust
19 lines
239 B
Rust
trait Dim {
|
|
fn dim() -> usize;
|
|
}
|
|
|
|
enum Dim3 {}
|
|
|
|
impl Dim for Dim3 {
|
|
fn dim() -> usize {
|
|
3
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let array: [usize; Dim3::dim()]
|
|
//~^ ERROR E0015
|
|
= [0; Dim3::dim()];
|
|
//~^ ERROR E0015
|
|
}
|