Skip to content

Commit eaeebb5

Browse files
committed
Clearer error message for dead assign
1 parent 9abc231 commit eaeebb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/middle/liveness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,10 +1658,10 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
16581658
if let Some(name) = self.should_warn(var) {
16591659
if is_argument {
16601660
self.ir.tcx.lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
1661-
&format!("value passed to `{}` is never read", name));
1661+
&format!("value passed to `{}` is never read (maybe it is overwritten before being read)", name));
16621662
} else {
16631663
self.ir.tcx.lint_hir(lint::builtin::UNUSED_ASSIGNMENTS, hir_id, sp,
1664-
&format!("value assigned to `{}` is never read", name));
1664+
&format!("value assigned to `{}` is never read (maybe it is overwritten before being read)", name));
16651665
}
16661666
}
16671667
}

0 commit comments

Comments
 (0)