Update E0162 to the new format

This commit is contained in:
Krzysztof Garczynski 2016-08-08 21:42:49 +02:00
parent b42a384a80
commit daf7c60d16
2 changed files with 5 additions and 1 deletions

View File

@ -316,7 +316,10 @@ fn check_arms(cx: &MatchCheckCtxt,
let &(ref first_arm_pats, _) = &arms[0];
let first_pat = &first_arm_pats[0];
let span = first_pat.span;
span_err!(cx.tcx.sess, span, E0162, "irrefutable if-let pattern");
struct_span_err!(cx.tcx.sess, span, E0162,
"irrefutable if-let pattern")
.span_label(span, &format!("irrefutable pattern"))
.emit();
printed_if_let_err = true;
}
},

View File

@ -13,6 +13,7 @@
fn main() {
let irr = Irrefutable(0);
if let Irrefutable(x) = irr { //~ ERROR E0162
//~| NOTE irrefutable pattern
println!("{}", x);
}
}