Changing label to "this is an..."
This commit is contained in:
parent
eeda69fcca
commit
034e659411
2 changed files with 5 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ 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 => (),
|
||||
|
|
@ -30,7 +30,7 @@ fn main() {
|
|||
//~^ 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 {
|
||||
|
|
@ -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);
|
||||
|
|
@ -48,6 +48,6 @@ fn main() {
|
|||
_ => (),
|
||||
anything => ()
|
||||
//~^ ERROR unreachable pattern
|
||||
//~^^ NOTE this is unreachable pattern
|
||||
//~^^ NOTE this is an unreachable pattern
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue