2017-04-21 17:10:22 +03:00
|
|
|
trait Dim {
|
|
|
|
fn dim() -> usize;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Dim3 {}
|
|
|
|
|
|
|
|
impl Dim for Dim3 {
|
|
|
|
fn dim() -> usize {
|
|
|
|
3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let array: [usize; Dim3::dim()]
|
2018-01-16 09:28:27 +01:00
|
|
|
//~^ ERROR E0015
|
2018-11-16 18:38:28 +01:00
|
|
|
//~| ERROR E0080
|
2017-04-21 17:10:22 +03:00
|
|
|
= [0; Dim3::dim()];
|
2018-01-16 09:28:27 +01:00
|
|
|
//~^ ERROR E0015
|
2018-11-16 18:38:28 +01:00
|
|
|
//~| ERROR E0080
|
2017-04-21 17:10:22 +03:00
|
|
|
}
|