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 authored and pietroalbini committed Dec 31, 2018
1 parent e3a4e97 commit 48d930c
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 48d930c

Please sign in to comment.