Skip to content

Commit 28c5edb

Browse files
committed
E0165 Update error format #35270
- Fixes #35270 - Part of #35233 r? @jonathandturner
1 parent 6355528 commit 28c5edb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustc_const_eval/check_match.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ fn check_arms(cx: &MatchCheckCtxt,
324324
let &(ref first_arm_pats, _) = &arms[0];
325325
let first_pat = &first_arm_pats[0];
326326
let span = first_pat.span;
327-
span_err!(cx.tcx.sess, span, E0165, "irrefutable while-let pattern");
327+
struct_span_err!(cx.tcx.sess, span, E0165,
328+
"irrefutable while-let pattern")
329+
.span_label(span, &format!("irrefutable pattern"))
330+
.emit();
328331
},
329332

330333
hir::MatchSource::ForLoopDesugar => {

src/test/compile-fail/E0165.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct Irrefutable(i32);
1313
fn main() {
1414
let irr = Irrefutable(0);
1515
while let Irrefutable(x) = irr { //~ ERROR E0165
16+
//~| irrefutable pattern
1617
// ...
1718
}
1819
}

0 commit comments

Comments
 (0)