Fixed E0529's label and unit test
This commit is contained in:
parent
147371f58f
commit
7f95bb0dbd
2 changed files with 7 additions and 2 deletions
|
|
@ -270,7 +270,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
err.emit();
|
||||
|
||||
err.span_label( pat.span,
|
||||
&format!("pattern cannot match with input type `{}`", expected_ty)
|
||||
).emit();
|
||||
}
|
||||
(tcx.types.err, tcx.types.err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@
|
|||
fn main() {
|
||||
let r: f32 = 1.0;
|
||||
match r {
|
||||
[a, b] => { //~ ERROR E0529
|
||||
[a, b] => {
|
||||
//~^ ERROR E0529
|
||||
//~| NOTE pattern cannot match with input type `f32`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue