]> git.lizzy.rs Git - rust.git/commitdiff
mark applicability
authorcsmoe <35686186+csmoe@users.noreply.github.com>
Sun, 13 May 2018 13:10:15 +0000 (21:10 +0800)
committercsmoe <35686186+csmoe@users.noreply.github.com>
Sun, 13 May 2018 13:10:15 +0000 (21:10 +0800)
src/librustc/middle/liveness.rs
src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs

index acdd5e6acad0430b760102ef38ed8769f24fe4dd..7d7417ab7e19835d2e5a87393b53191a5b3ff8d5 100644 (file)
 use self::LiveNodeKind::*;
 use self::VarKind::*;
 
+use errors::Applicability;
 use hir::def::*;
 use ty::{self, TyCtxt};
 use lint;
@@ -1558,8 +1559,9 @@ fn warn_about_unused(&self,
                         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()
                 }
index 100fb6d3533f5961f0da0136a2ead6f0236cd479..28d304699002f2370d42d211c17a6550f76dc0df 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-pass
+// run-rustfix
 
 #![feature(box_syntax)]
 #![feature(box_patterns)]