Skip to content

Commit 7f95bb0

Browse files
author
Eugene R Gonzalez
committed
Fixed E0529's label and unit test
1 parent 147371f commit 7f95bb0

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
@@ -270,7 +270,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
270270
_ => {}
271271
}
272272
}
273-
err.emit();
273+
274+
err.span_label( pat.span,
275+
&format!("pattern cannot match with input type `{}`", expected_ty)
276+
).emit();
274277
}
275278
(tcx.types.err, tcx.types.err)
276279
}

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)