2018-12-11 00:05:35 +00:00
|
|
|
enum Foo {}
|
|
|
|
struct Bar {}
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn foo() {
|
|
|
|
let _ = Self;
|
2018-12-15 17:31:46 +00:00
|
|
|
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
|
2018-12-11 00:05:35 +00:00
|
|
|
let _ = Self();
|
2018-12-15 17:31:46 +00:00
|
|
|
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
|
2018-12-11 00:05:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Bar {
|
|
|
|
fn bar() {
|
|
|
|
let _ = Self;
|
2018-12-15 17:31:46 +00:00
|
|
|
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
|
2018-12-11 00:05:35 +00:00
|
|
|
let _ = Self();
|
2018-12-15 17:31:46 +00:00
|
|
|
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
|
2018-12-11 00:05:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|