Skip to content

Commit

Permalink
Update E0162 to the new format
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofgarczynski committed Aug 8, 2016
1 parent b42a384 commit daf7c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_const_eval/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0162.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct Irrefutable(i32);
fn main() {
let irr = Irrefutable(0);
if let Irrefutable(x) = irr { //~ ERROR E0162
//~| NOTE irrefutable pattern
println!("{}", x);
}
}

0 comments on commit daf7c60

Please sign in to comment.