2017-04-21 09:10:22 -05: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 02:28:27 -06:00
|
|
|
//~^ ERROR E0015
|
2017-04-21 09:10:22 -05:00
|
|
|
= [0; Dim3::dim()];
|
2018-01-16 02:28:27 -06:00
|
|
|
//~^ ERROR E0015
|
2017-04-21 09:10:22 -05:00
|
|
|
}
|