Skip to content

Commit

Permalink
Fixed E0529's label and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene R Gonzalez committed Sep 2, 2016
1 parent 147371f commit 7f95bb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/librustc_typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0529.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
}
}

0 comments on commit 7f95bb0

Please sign in to comment.