Added test for issue #56835.

This commit is contained in:
Alexander Regueiro 2018-12-15 04:33:54 +00:00
parent 3199bef055
commit 5656c96c71
2 changed files with 25 additions and 0 deletions

View file

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

View file

@ -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`.