Skip to content

Commit

Permalink
E0165 Update error format #35270
Browse files Browse the repository at this point in the history
- Fixes #35270
- Part of #35233

r? @jonathandturner
  • Loading branch information
gavinb committed Aug 29, 2016
1 parent 6355528 commit 28c5edb
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 @@ -324,7 +324,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, E0165, "irrefutable while-let pattern");
struct_span_err!(cx.tcx.sess, span, E0165,
"irrefutable while-let pattern")
.span_label(span, &format!("irrefutable pattern"))
.emit();
},

hir::MatchSource::ForLoopDesugar => {
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0165.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);
while let Irrefutable(x) = irr { //~ ERROR E0165
//~| irrefutable pattern
// ...
}
}

0 comments on commit 28c5edb

Please sign in to comment.