Added test for issue #56835.
This commit is contained in:
parent
3199bef055
commit
5656c96c71
2 changed files with 25 additions and 0 deletions
10
src/test/ui/issues/issue-56835.rs
Normal file
10
src/test/ui/issues/issue-56835.rs
Normal 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() {}
|
15
src/test/ui/issues/issue-56835.stderr
Normal file
15
src/test/ui/issues/issue-56835.stderr
Normal 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`.
|
Loading…
Reference in a new issue