summary refs log tree commit diff
path: root/src/test/ui/feature-gates/feature-gate-self-struct-ctor.rs
blob: 98eab3949132046005f628d9dc0dd95455c91a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct ST1(i32, i32);

impl ST1 {
    fn ctor() -> Self {
        Self(1,2)
        //~^ ERROR: `Self` struct constructors are unstable (see issue #51994) [E0658]
    }
}

struct ST2;

impl ST2 {
    fn ctor() -> Self {
        Self
        //~^ ERROR: `Self` struct constructors are unstable (see issue #51994) [E0658]
    }
}

fn main() {
    let _ = ST1::ctor();
    let _ = ST2::ctor();
}