Rollup merge of #44569 - est31:master, r=estebank

"avoid" is a better word here than "disable"

You don't "disable" the warning really, you just avoid it (as a conscious action).
This commit is contained in:
Corey Farwell 2017-09-14 22:32:51 -04:00 committed by GitHub
commit 2a86884a37
2 changed files with 3 additions and 3 deletions

View file

@ -1487,12 +1487,12 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
self.ir.tcx.lint_node_note(lint::builtin::UNUSED_VARIABLES, id, sp,
&format!("variable `{}` is assigned to, but never used",
name),
&format!("to disable this warning, consider using `_{}` instead",
&format!("to avoid this warning, consider using `_{}` instead",
name));
} else if name != "self" {
self.ir.tcx.lint_node_note(lint::builtin::UNUSED_VARIABLES, id, sp,
&format!("unused variable: `{}`", name),
&format!("to disable this warning, consider using `_{}` instead",
&format!("to avoid this warning, consider using `_{}` instead",
name));
}
}

View file

@ -10,7 +10,7 @@ note: lint level defined here
18 | #![warn(unused)]
| ^^^^^^
= note: #[warn(unused_variables)] implied by #[warn(unused)]
= note: to disable this warning, consider using `_theOtherTwo` instead
= note: to avoid this warning, consider using `_theOtherTwo` instead
warning: variable `theTwo` should have a snake case name such as `the_two`
--> $DIR/issue-24690.rs:22:9