forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
149 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
enum Foo {} | ||
struct Bar {} | ||
|
||
impl Foo { | ||
fn foo() { | ||
let _ = Self; | ||
//~^ ERROR the `Self` constructor can only be used with tuple structs | ||
let _ = Self(); | ||
//~^ ERROR the `Self` constructor can only be used with tuple structs | ||
} | ||
} | ||
|
||
impl Bar { | ||
fn bar() { | ||
let _ = Self; | ||
//~^ ERROR the `Self` constructor can only be used with tuple structs | ||
let _ = Self(); | ||
//~^ ERROR the `Self` constructor can only be used with tuple structs | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error: the `Self` constructor can only be used with tuple structs | ||
--> $DIR/issue-56199.rs:7:17 | ||
| | ||
LL | let _ = Self; | ||
| ^^^^ | ||
| | ||
= note: did you mean to use one of the enum's variants? | ||
|
||
error: the `Self` constructor can only be used with tuple structs | ||
--> $DIR/issue-56199.rs:9:17 | ||
| | ||
LL | let _ = Self(); | ||
| ^^^^ | ||
| | ||
= note: did you mean to use one of the enum's variants? | ||
|
||
error: the `Self` constructor can only be used with tuple structs | ||
--> $DIR/issue-56199.rs:16:17 | ||
| | ||
LL | let _ = Self; | ||
| ^^^^ did you mean `Self { /* fields */ }`? | ||
|
||
error: the `Self` constructor can only be used with tuple structs | ||
--> $DIR/issue-56199.rs:18:17 | ||
| | ||
LL | let _ = Self(); | ||
| ^^^^ did you mean `Self { /* fields */ }`? | ||
|
||
error: aborting due to 4 previous errors | ||
|