blob: 4dc6c2e47a9eab522d67ac8666a3c9dbd9883ce2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// run-pass
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
trait MyTrait {
type ArrayType;
const SIZE: usize;
const ARRAY: Self::ArrayType;
}
impl MyTrait for () {
type ArrayType = [u8; Self::SIZE];
const SIZE: usize = 4;
const ARRAY: [u8; Self::SIZE] = [1, 2, 3, 4];
}
fn main() {
let _ = <() as MyTrait>::ARRAY;
}
|