2023-05-14 07:48:57 -05:00
|
|
|
// `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);
|
2024-04-19 21:54:53 -05:00
|
|
|
//~^ WARN can't reference `Self` constructor from outer item
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out
|
2023-05-14 07:48:57 -05:00
|
|
|
fn bar() -> S0 {
|
|
|
|
Self(0)
|
2024-04-19 21:54:53 -05:00
|
|
|
//~^ WARN can't reference `Self` constructor from outer item
|
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out
|
2023-05-14 07:48:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|