File tree 3 files changed +46
-0
lines changed
src/test/ui/mismatched_types
3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ // run-rustfix
2
+
3
+ struct _S(u32, Vec<i32>);
4
+
5
+ fn _foo(x: &_S) {
6
+ match x {
7
+ _S(mut _y, _v) => {
8
+ //~^ ERROR mismatched types [E0308]
9
+ }
10
+ }
11
+ }
12
+
13
+ fn main() {
14
+ }
Original file line number Diff line number Diff line change
1
+ // run-rustfix
2
+
3
+ struct _S ( u32 , Vec < i32 > ) ;
4
+
5
+ fn _foo ( x : & _S ) {
6
+ match x {
7
+ _S( & ( mut _y) , _v) => {
8
+ //~^ ERROR mismatched types [E0308]
9
+ }
10
+ }
11
+ }
12
+
13
+ fn main ( ) {
14
+ }
Original file line number Diff line number Diff line change
1
+ error[E0308]: mismatched types
2
+ --> $DIR/issue-106182.rs:7:12
3
+ |
4
+ LL | match x {
5
+ | - this expression has type `&_S`
6
+ LL | _S(& (mut _y), _v) => {
7
+ | ^^^^^^^^^^ expected `u32`, found reference
8
+ |
9
+ = note: expected type `u32`
10
+ found reference `&_`
11
+ help: consider removing `&` from the pattern
12
+ |
13
+ LL | _S(mut _y, _v) => {
14
+ | ~~~~~~
15
+
16
+ error: aborting due to previous error
17
+
18
+ For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments