mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
23 lines
546 B
Rust
23 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() {}
|