-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
1 parent
e3a4e97
commit 48d930c
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
pub struct Foo {} | ||
|
||
impl Foo { | ||
fn bar(Self(foo): Self) {} | ||
//~^ ERROR the `Self` constructor can only be used with tuple structs | ||
//~^^ ERROR expected tuple struct/variant, found self constructor `Self` [E0164] | ||
} | ||
|
||
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,15 @@ | ||
error: the `Self` constructor can only be used with tuple structs | ||
--> $DIR/issue-56835.rs:5:12 | ||
| | ||
LL | fn bar(Self(foo): Self) {} | ||
| ^^^^^^^^^ did you mean `Self { /* fields */ }`? | ||
|
||
error[E0164]: expected tuple struct/variant, found self constructor `Self` | ||
--> $DIR/issue-56835.rs:5:12 | ||
| | ||
LL | fn bar(Self(foo): Self) {} | ||
| ^^^^^^^^^ not a tuple variant or struct | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0164`. |