rust/tests/ui/issues/issue-56199.rs
2023-01-11 09:32:08 +00:00

22 lines
546 B
Rust

enum Foo {}
struct Bar {}
impl Foo {
fn foo() {
let _ = Self;
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
let _ = Self();
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
}
}
impl Bar {
fn bar() {
let _ = Self;
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
let _ = Self();
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
}
}
fn main() {}