]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/defaults/mismatch.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / const-generics / defaults / mismatch.rs
CommitLineData
cdc7bbd5 1#![feature(const_generics_defaults)]
cdc7bbd5
XL
2
3pub struct Example<const N: usize=13>;
4pub struct Example2<T=u32, const N: usize=13>(T);
5pub struct Example3<const N: usize=13, T=u32>(T);
6pub struct Example4<const N: usize=13, const M: usize=4>;
7
8fn 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}