rust/tests/ui/issues/issue-56199.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
546 B
Rust
Raw Normal View History

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() {}