summary refs log tree commit diff
path: root/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.rs
blob: 9af84439252c7e0c3fb80d45510aadd40a8e1f05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}