blob: c32cf9df6946e18cfa95b67b69fc82d86aabd5b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// `Self` as a constructor is currently allowed when the outer item is not generic.
//@ check-pass
struct S0(usize);
impl S0 {
fn foo() {
const C: S0 = Self(0);
//~^ WARN can't reference `Self` constructor from outer item
//~| WARN this was previously accepted by the compiler but is being phased out
fn bar() -> S0 {
Self(0)
//~^ WARN can't reference `Self` constructor from outer item
//~| WARN this was previously accepted by the compiler but is being phased out
}
}
}
fn main() {}
|