mark applicability

This commit is contained in:
csmoe 2018-05-13 21:10:15 +08:00
parent 6c682eb46a
commit a880971128
2 changed files with 5 additions and 2 deletions

@ -106,6 +106,7 @@ use self::LoopKind::*;
use self::LiveNodeKind::*;
use self::VarKind::*;
use errors::Applicability;
use hir::def::*;
use ty::{self, TyCtxt};
use lint;
@ -1558,8 +1559,9 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
err.span_suggestion(sp, "try ignoring the field",
format!("{}: _", name));
} else {
err.span_suggestion_short(sp, &suggest_underscore_msg,
format!("_{}", name));
err.span_suggestion_with_applicability(
sp, &suggest_underscore_msg,
format!("_{}", name), Applicability::MachineApplicable);
}
err.emit()
}

@ -9,6 +9,7 @@
// except according to those terms.
// compile-pass
// run-rustfix
#![feature(box_syntax)]
#![feature(box_patterns)]