@@ -189,13 +189,13 @@ declare_lint_pass!(Write => [
189
189
impl EarlyLintPass for Write {
190
190
fn check_mac ( & mut self , cx : & EarlyContext < ' _ > , mac : & Mac ) {
191
191
if mac. path == sym ! ( println) {
192
- span_lint ( cx, PRINT_STDOUT , mac. span , "use of `println!`" ) ;
193
- if let ( Some ( fmt_str) , _) = check_tts ( cx, & mac. tts , false ) {
192
+ span_lint ( cx, PRINT_STDOUT , mac. span ( ) , "use of `println!`" ) ;
193
+ if let ( Some ( fmt_str) , _) = check_tts ( cx, & mac. args . inner_tokens ( ) , false ) {
194
194
if fmt_str. symbol == Symbol :: intern ( "" ) {
195
195
span_lint_and_sugg (
196
196
cx,
197
197
PRINTLN_EMPTY_STRING ,
198
- mac. span ,
198
+ mac. span ( ) ,
199
199
"using `println!(\" \" )`" ,
200
200
"replace it with" ,
201
201
"println!()" . to_string ( ) ,
@@ -204,13 +204,13 @@ impl EarlyLintPass for Write {
204
204
}
205
205
}
206
206
} else if mac. path == sym ! ( print) {
207
- span_lint ( cx, PRINT_STDOUT , mac. span , "use of `print!`" ) ;
208
- if let ( Some ( fmt_str) , _) = check_tts ( cx, & mac. tts , false ) {
207
+ span_lint ( cx, PRINT_STDOUT , mac. span ( ) , "use of `print!`" ) ;
208
+ if let ( Some ( fmt_str) , _) = check_tts ( cx, & mac. args . inner_tokens ( ) , false ) {
209
209
if check_newlines ( & fmt_str) {
210
210
span_lint_and_then (
211
211
cx,
212
212
PRINT_WITH_NEWLINE ,
213
- mac. span ,
213
+ mac. span ( ) ,
214
214
"using `print!()` with a format string that ends in a single newline" ,
215
215
|err| {
216
216
err. multipart_suggestion (
@@ -226,12 +226,12 @@ impl EarlyLintPass for Write {
226
226
}
227
227
}
228
228
} else if mac. path == sym ! ( write) {
229
- if let ( Some ( fmt_str) , _) = check_tts ( cx, & mac. tts , true ) {
229
+ if let ( Some ( fmt_str) , _) = check_tts ( cx, & mac. args . inner_tokens ( ) , true ) {
230
230
if check_newlines ( & fmt_str) {
231
231
span_lint_and_then (
232
232
cx,
233
233
WRITE_WITH_NEWLINE ,
234
- mac. span ,
234
+ mac. span ( ) ,
235
235
"using `write!()` with a format string that ends in a single newline" ,
236
236
|err| {
237
237
err. multipart_suggestion (
@@ -247,7 +247,7 @@ impl EarlyLintPass for Write {
247
247
}
248
248
}
249
249
} else if mac. path == sym ! ( writeln) {
250
- if let ( Some ( fmt_str) , expr) = check_tts ( cx, & mac. tts , true ) {
250
+ if let ( Some ( fmt_str) , expr) = check_tts ( cx, & mac. args . inner_tokens ( ) , true ) {
251
251
if fmt_str. symbol == Symbol :: intern ( "" ) {
252
252
let mut applicability = Applicability :: MachineApplicable ;
253
253
let suggestion = expr. map_or_else (
@@ -261,7 +261,7 @@ impl EarlyLintPass for Write {
261
261
span_lint_and_sugg (
262
262
cx,
263
263
WRITELN_EMPTY_STRING ,
264
- mac. span ,
264
+ mac. span ( ) ,
265
265
format ! ( "using `writeln!({}, \" \" )`" , suggestion) . as_str ( ) ,
266
266
"replace it with" ,
267
267
format ! ( "writeln!({})" , suggestion) ,
0 commit comments