Clearer error message for dead assign
This commit is contained in:
parent
9abc231212
commit
eaeebb55e1
1 changed files with 2 additions and 2 deletions
|
|
@ -1658,10 +1658,10 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
if let Some(name) = self.should_warn(var) {
|
||||
if is_argument {
|
||||
self.ir.tcx.lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
|
||||
&format!("value passed to `{}` is never read", name));
|
||||
&format!("value passed to `{}` is never read (maybe it is overwritten before being read)", name));
|
||||
} else {
|
||||
self.ir.tcx.lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
|
||||
&format!("value assigned to `{}` is never read", name));
|
||||
&format!("value assigned to `{}` is never read (maybe it is overwritten before being read)", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue