Skip to content

Commit

Permalink
Changing label to "this is an..."
Browse files Browse the repository at this point in the history
  • Loading branch information
saml committed Aug 4, 2016
1 parent eeda69f commit 034e659
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/librustc_const_eval/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ fn check_arms(cx: &MatchCheckCtxt,
hir::MatchSource::Normal => {
let mut err = struct_span_err!(cx.tcx.sess, pat.span, E0001,
"unreachable pattern");
err.span_label(pat.span, &format!("this is unreachable pattern"));
err.span_label(pat.span, &format!("this is an unreachable pattern"));
// if we had a catchall pattern, hint at that
for row in &seen.0 {
if pat_is_catchall(&cx.tcx.def_map.borrow(), row[0].0) {
Expand Down
8 changes: 4 additions & 4 deletions src/test/compile-fail/issue-31221.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ fn main() {
//~^ NOTE this pattern matches any value
Var2 => (),
//~^ ERROR unreachable pattern
//~^^ NOTE this is unreachable pattern
//~^^ NOTE this is an unreachable pattern
};
match &s {
&Var1 => (),
&Var3 => (),
//~^ NOTE this pattern matches any value
&Var2 => (),
//~^ ERROR unreachable pattern
//~^^ NOTE this is unreachable pattern
//~^^ NOTE this is an unreachable pattern
};
let t = (Var1, Var1);
match t {
Expand All @@ -39,7 +39,7 @@ fn main() {
//~^ NOTE this pattern matches any value
anything => ()
//~^ ERROR unreachable pattern
//~^^ NOTE this is unreachable pattern
//~^^ NOTE this is an unreachable pattern
};
// `_` need not emit a note, it is pretty obvious already.
let t = (Var1, Var1);
Expand All @@ -48,6 +48,6 @@ fn main() {
_ => (),
anything => ()
//~^ ERROR unreachable pattern
//~^^ NOTE this is unreachable pattern
//~^^ NOTE this is an unreachable pattern
};
}

0 comments on commit 034e659

Please sign in to comment.