]>
Commit | Line | Data |
---|---|---|
cdc7bbd5 | 1 | #![feature(const_generics_defaults)] |
cdc7bbd5 XL |
2 | |
3 | pub struct Example<const N: usize=13>; | |
4 | pub struct Example2<T=u32, const N: usize=13>(T); | |
5 | pub struct Example3<const N: usize=13, T=u32>(T); | |
6 | pub struct Example4<const N: usize=13, const M: usize=4>; | |
7 | ||
8 | fn main() { | |
9 | let e: Example::<13> = (); | |
10 | //~^ Error: mismatched types | |
17df50a5 | 11 | //~| expected struct `Example` |
cdc7bbd5 XL |
12 | let e: Example2::<u32, 13> = (); |
13 | //~^ Error: mismatched types | |
17df50a5 | 14 | //~| expected struct `Example2` |
cdc7bbd5 XL |
15 | let e: Example3::<13, u32> = (); |
16 | //~^ Error: mismatched types | |
17df50a5 | 17 | //~| expected struct `Example3` |
cdc7bbd5 XL |
18 | let e: Example3::<7> = (); |
19 | //~^ Error: mismatched types | |
17df50a5 | 20 | //~| expected struct `Example3<7_usize>` |
cdc7bbd5 XL |
21 | let e: Example4::<7> = (); |
22 | //~^ Error: mismatched types | |
17df50a5 | 23 | //~| expected struct `Example4<7_usize>` |
cdc7bbd5 | 24 | } |