about summary refs log tree commit diff
path: root/src/test/ui/const-generics/different_byref.rs
blob: 7977560ecbcf1edc4827c1b28d6faf72a22f7ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Check that different const types are different.
// revisions: full min

#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]

struct Const<const V: [usize; 1]> {}
//[min]~^ ERROR `[usize; 1]` is forbidden

fn main() {
    let mut x = Const::<{ [3] }> {};
    x = Const::<{ [4] }> {};
    //[full]~^ ERROR mismatched types
}