Rollup merge of #36210 - EugeneGonzalez:E0529, r=jonathandturner

Fixed E0529's label and unit test

Fixes #36195 part of #35233.

This is ready for review, but will likely fail Travis due to #36138. I changed the wording of the label, so feedback on that would be appreciated.

r? @jonathandturner
This commit is contained in:
Jonathan Turner 2016-09-02 15:28:52 -07:00 committed by GitHub
commit 5284bee03a
2 changed files with 7 additions and 2 deletions

View File

@ -273,7 +273,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)
}

View File

@ -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`
}
}
}