File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ pub struct Foo { }
3
+
4
+ impl Foo {
5
+ fn bar ( Self ( foo) : Self ) { }
6
+ //~^ ERROR the `Self` constructor can only be used with tuple structs
7
+ //~^^ ERROR expected tuple struct/variant, found self constructor `Self` [E0164]
8
+ }
9
+
10
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: the `Self` constructor can only be used with tuple structs
2
+ --> $DIR/issue-56835.rs:5:12
3
+ |
4
+ LL | fn bar(Self(foo): Self) {}
5
+ | ^^^^^^^^^ did you mean `Self { /* fields */ }`?
6
+
7
+ error[E0164]: expected tuple struct/variant, found self constructor `Self`
8
+ --> $DIR/issue-56835.rs:5:12
9
+ |
10
+ LL | fn bar(Self(foo): Self) {}
11
+ | ^^^^^^^^^ not a tuple variant or struct
12
+
13
+ error: aborting due to 2 previous errors
14
+
15
+ For more information about this error, try `rustc --explain E0164`.
You can’t perform that action at this time.
0 commit comments