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