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:
commit
2a86884a37
2 changed files with 3 additions and 3 deletions
|
@ -1487,12 +1487,12 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
||||||
self.ir.tcx.lint_node_note(lint::builtin::UNUSED_VARIABLES, id, sp,
|
self.ir.tcx.lint_node_note(lint::builtin::UNUSED_VARIABLES, id, sp,
|
||||||
&format!("variable `{}` is assigned to, but never used",
|
&format!("variable `{}` is assigned to, but never used",
|
||||||
name),
|
name),
|
||||||
&format!("to disable this warning, consider using `_{}` instead",
|
&format!("to avoid this warning, consider using `_{}` instead",
|
||||||
name));
|
name));
|
||||||
} else if name != "self" {
|
} else if name != "self" {
|
||||||
self.ir.tcx.lint_node_note(lint::builtin::UNUSED_VARIABLES, id, sp,
|
self.ir.tcx.lint_node_note(lint::builtin::UNUSED_VARIABLES, id, sp,
|
||||||
&format!("unused variable: `{}`", name),
|
&format!("unused variable: `{}`", name),
|
||||||
&format!("to disable this warning, consider using `_{}` instead",
|
&format!("to avoid this warning, consider using `_{}` instead",
|
||||||
name));
|
name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ note: lint level defined here
|
||||||
18 | #![warn(unused)]
|
18 | #![warn(unused)]
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
= note: #[warn(unused_variables)] implied by #[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`
|
warning: variable `theTwo` should have a snake case name such as `the_two`
|
||||||
--> $DIR/issue-24690.rs:22:9
|
--> $DIR/issue-24690.rs:22:9
|
||||||
|
|
Loading…
Reference in a new issue