1
Fork 0

Change type param -> generic param

This commit is contained in:
Ellen 2021-07-14 19:22:32 +01:00
parent ee5ed4a88d
commit da189d9514
6 changed files with 60 additions and 23 deletions

View file

@ -0,0 +1,16 @@
#![feature(const_generics_defaults)]
struct Struct<const N: usize = { Self; 10 }>;
//~^ ERROR generic parameters cannot use `Self` in their defaults [E0735]
enum Enum<const N: usize = { Self; 10 }> { }
//~^ ERROR generic parameters cannot use `Self` in their defaults [E0735]
union Union<const N: usize = { Self; 10 }> { not_empty: () }
//~^ ERROR generic parameters cannot use `Self` in their defaults [E0735]
fn main() {
let _: Struct;
let _: Enum;
let _: Union;
}