Skip to content

Commit

Permalink
Added test for issue #56835.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Regueiro committed Dec 15, 2018
1 parent 700651c commit bf5c5e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/ui/issues/issue-56835.rs
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() {}
15 changes: 15 additions & 0 deletions src/test/ui/issues/issue-56835.stderr
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`.

0 comments on commit bf5c5e3

Please sign in to comment.