Add ui test for #106182
This commit is contained in:
parent
cc1dee148d
commit
a74a48852a
3 changed files with 46 additions and 0 deletions
14
src/test/ui/mismatched_types/issue-106182.fixed
Normal file
14
src/test/ui/mismatched_types/issue-106182.fixed
Normal file
|
|
@ -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
src/test/ui/mismatched_types/issue-106182.rs
Normal file
14
src/test/ui/mismatched_types/issue-106182.rs
Normal file
|
|
@ -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
src/test/ui/mismatched_types/issue-106182.stderr
Normal file
18
src/test/ui/mismatched_types/issue-106182.stderr
Normal file
|
|
@ -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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue