Skip to content

Commit

Permalink
Add ui test for rust-lang#106182
Browse files Browse the repository at this point in the history
  • Loading branch information
obeis committed Dec 30, 2022
1 parent cc1dee1 commit a74a488
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/ui/mismatched_types/issue-106182.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// run-rustfix

struct _S(u32, Vec<i32>);

fn _foo(x: &_S) {
match x {
_S(mut _y, _v) => {
//~^ ERROR mismatched types [E0308]
}
}
}

fn main() {
}
14 changes: 14 additions & 0 deletions src/test/ui/mismatched_types/issue-106182.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// run-rustfix

struct _S(u32, Vec<i32>);

fn _foo(x: &_S) {
match x {
_S(& (mut _y), _v) => {
//~^ ERROR mismatched types [E0308]
}
}
}

fn main() {
}
18 changes: 18 additions & 0 deletions src/test/ui/mismatched_types/issue-106182.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0308]: mismatched types
--> $DIR/issue-106182.rs:7:12
|
LL | match x {
| - this expression has type `&_S`
LL | _S(& (mut _y), _v) => {
| ^^^^^^^^^^ expected `u32`, found reference
|
= note: expected type `u32`
found reference `&_`
help: consider removing `&` from the pattern
|
LL | _S(mut _y, _v) => {
| ~~~~~~

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.

0 comments on commit a74a488

Please sign in to comment.