2022-07-18 18:25:14 -05:00
|
|
|
pub struct Example<const N: usize = 13>;
|
|
|
|
pub struct Example2<T = u32, const N: usize = 13>(T);
|
|
|
|
pub struct Example3<const N: usize = 13, T = u32>(T);
|
|
|
|
pub struct Example4<const N: usize = 13, const M: usize = 4>;
|
2021-03-22 18:26:07 -05:00
|
|
|
|
|
|
|
fn main() {
|
2022-07-18 18:25:14 -05:00
|
|
|
let e: Example<13> = ();
|
2021-03-29 03:32:27 -05:00
|
|
|
//~^ Error: mismatched types
|
2021-06-07 04:09:47 -05:00
|
|
|
//~| expected struct `Example`
|
2022-07-18 18:25:14 -05:00
|
|
|
let e: Example2<u32, 13> = ();
|
2021-03-29 03:32:27 -05:00
|
|
|
//~^ Error: mismatched types
|
2021-06-07 04:09:47 -05:00
|
|
|
//~| expected struct `Example2`
|
2022-07-18 18:25:14 -05:00
|
|
|
let e: Example3<13, u32> = ();
|
2021-03-29 03:32:27 -05:00
|
|
|
//~^ Error: mismatched types
|
2021-06-07 04:09:47 -05:00
|
|
|
//~| expected struct `Example3`
|
2022-07-18 18:25:14 -05:00
|
|
|
let e: Example3<7> = ();
|
2021-03-29 03:32:27 -05:00
|
|
|
//~^ Error: mismatched types
|
2022-07-18 18:25:14 -05:00
|
|
|
//~| expected struct `Example3<7>`
|
|
|
|
let e: Example4<7> = ();
|
2021-03-29 03:32:27 -05:00
|
|
|
//~^ Error: mismatched types
|
2022-07-18 18:25:14 -05:00
|
|
|
//~| expected struct `Example4<7>`
|
2021-03-22 18:26:07 -05:00
|
|
|
}
|