2022-07-19 02:25:14 +03: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 23:26:07 +00:00
|
|
|
|
|
|
|
fn main() {
|
2022-07-19 02:25:14 +03:00
|
|
|
let e: Example<13> = ();
|
2021-03-29 17:32:27 +09:00
|
|
|
//~^ Error: mismatched types
|
2021-06-07 10:09:47 +01:00
|
|
|
//~| expected struct `Example`
|
2022-07-19 02:25:14 +03:00
|
|
|
let e: Example2<u32, 13> = ();
|
2021-03-29 17:32:27 +09:00
|
|
|
//~^ Error: mismatched types
|
2021-06-07 10:09:47 +01:00
|
|
|
//~| expected struct `Example2`
|
2022-07-19 02:25:14 +03:00
|
|
|
let e: Example3<13, u32> = ();
|
2021-03-29 17:32:27 +09:00
|
|
|
//~^ Error: mismatched types
|
2021-06-07 10:09:47 +01:00
|
|
|
//~| expected struct `Example3`
|
2022-07-19 02:25:14 +03:00
|
|
|
let e: Example3<7> = ();
|
2021-03-29 17:32:27 +09:00
|
|
|
//~^ Error: mismatched types
|
2022-07-19 02:25:14 +03:00
|
|
|
//~| expected struct `Example3<7>`
|
|
|
|
let e: Example4<7> = ();
|
2021-03-29 17:32:27 +09:00
|
|
|
//~^ Error: mismatched types
|
2022-07-19 02:25:14 +03:00
|
|
|
//~| expected struct `Example4<7>`
|
2021-03-22 23:26:07 +00:00
|
|
|
}
|