Skip to content

Commit ec291dc

Browse files
author
Jonathan Turner
authored
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
2 parents 12c7a91 + 7f95bb0 commit ec291dc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/librustc_typeck/check/_match.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
273273
_ => {}
274274
}
275275
}
276-
err.emit();
276+
277+
err.span_label( pat.span,
278+
&format!("pattern cannot match with input type `{}`", expected_ty)
279+
).emit();
277280
}
278281
(tcx.types.err, tcx.types.err)
279282
}

src/test/compile-fail/E0529.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
fn main() {
1414
let r: f32 = 1.0;
1515
match r {
16-
[a, b] => { //~ ERROR E0529
16+
[a, b] => {
17+
//~^ ERROR E0529
18+
//~| NOTE pattern cannot match with input type `f32`
1719
}
1820
}
1921
}

0 commit comments

Comments
 (0)