Skip to content

Commit

Permalink
Rollup merge of rust-lang#36210 - EugeneGonzalez:E0529, r=jonathandtu…
Browse files Browse the repository at this point in the history
…rner

Fixed E0529's label and unit test

Fixes rust-lang#36195 part of rust-lang#35233.

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

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Sep 2, 2016
2 parents 12c7a91 + 7f95bb0 commit ec291dc
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 @@ -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)
}
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 ec291dc

Please sign in to comment.