rust/src/test/ui/issues/issue-56199.rs

23 lines
546 B
Rust
Raw Normal View History

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