rust/tests/ui/self/self-ctor-nongeneric.rs
2024-02-16 20:02:50 +00:00

16 lines
252 B
Rust

// `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);
fn bar() -> S0 {
Self(0)
}
}
}
fn main() {}