7
7
// option. This file may not be copied, modified, or distributed
8
8
// except according to those terms.
9
9
10
+ use crate :: rustc_errors:: Applicability ;
10
11
use crate :: rustc:: hir:: * ;
11
12
use crate :: rustc:: lint:: { LateContext , LateLintPass , LintArray , LintPass } ;
12
13
use crate :: rustc:: { declare_tool_lint, lint_array} ;
@@ -101,7 +102,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
101
102
dest_name
102
103
) ,
103
104
"try this" ,
104
- format!( "{}{}!(\" {}\" )" , prefix, macro_name. replace( "write" , "print" ) , write_output. escape_default( ) )
105
+ format!( "{}{}!(\" {}\" )" , prefix, macro_name. replace( "write" , "print" ) , write_output. escape_default( ) ) ,
106
+ Applicability :: MachineApplicable
105
107
) ;
106
108
} else {
107
109
span_lint_and_sugg(
@@ -110,7 +112,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
110
112
expr. span,
111
113
& format!( "use of `{}().write_fmt(...).unwrap()`" , dest_name) ,
112
114
"try this" ,
113
- format!( "{}print!(\" {}\" )" , prefix, write_output. escape_default( ) )
115
+ format!( "{}print!(\" {}\" )" , prefix, write_output. escape_default( ) ) ,
116
+ Applicability :: MachineApplicable
114
117
) ;
115
118
}
116
119
} else {
0 commit comments