Skip to content

Commit

Permalink
Rollup merge of rust-lang#35524 - garekkream:update-E0162-new-error-f…
Browse files Browse the repository at this point in the history
…ormat, r=jonathandturner

Update E0162 to the new format

Part of rust-lang#35233.
Fixes rust-lang#35268.

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 8, 2016
2 parents 7db3f86 + daf7c60 commit f835b38
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 f835b38

Please sign in to comment.