Skip to content

Commit a74a488

Browse files
committed
Add ui test for #106182
1 parent cc1dee1 commit a74a488

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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`.

0 commit comments

Comments
 (0)