Skip to content

Commit a880971

Browse files
committed
mark applicability
1 parent 6c682eb commit a880971

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc/middle/liveness.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ use self::LoopKind::*;
106106
use self::LiveNodeKind::*;
107107
use self::VarKind::*;
108108

109+
use errors::Applicability;
109110
use hir::def::*;
110111
use ty::{self, TyCtxt};
111112
use lint;
@@ -1558,8 +1559,9 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
15581559
err.span_suggestion(sp, "try ignoring the field",
15591560
format!("{}: _", name));
15601561
} else {
1561-
err.span_suggestion_short(sp, &suggest_underscore_msg,
1562-
format!("_{}", name));
1562+
err.span_suggestion_with_applicability(
1563+
sp, &suggest_underscore_msg,
1564+
format!("_{}", name), Applicability::MachineApplicable);
15631565
}
15641566
err.emit()
15651567
}

src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// compile-pass
12+
// run-rustfix
1213

1314
#![feature(box_syntax)]
1415
#![feature(box_patterns)]

0 commit comments

Comments
 (0)