@@ -189,13 +189,13 @@ declare_lint_pass!(Write => [
189189impl EarlyLintPass for Write {
190190 fn check_mac ( & mut self , cx : & EarlyContext < ' _ > , mac : & Mac ) {
191191 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 ) {
194194 if fmt_str. symbol == Symbol :: intern ( "" ) {
195195 span_lint_and_sugg (
196196 cx,
197197 PRINTLN_EMPTY_STRING ,
198- mac. span ,
198+ mac. span ( ) ,
199199 "using `println!(\" \" )`" ,
200200 "replace it with" ,
201201 "println!()" . to_string ( ) ,
@@ -204,13 +204,13 @@ impl EarlyLintPass for Write {
204204 }
205205 }
206206 } 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 ) {
209209 if check_newlines ( & fmt_str) {
210210 span_lint_and_then (
211211 cx,
212212 PRINT_WITH_NEWLINE ,
213- mac. span ,
213+ mac. span ( ) ,
214214 "using `print!()` with a format string that ends in a single newline" ,
215215 |err| {
216216 err. multipart_suggestion (
@@ -226,12 +226,12 @@ impl EarlyLintPass for Write {
226226 }
227227 }
228228 } 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 ) {
230230 if check_newlines ( & fmt_str) {
231231 span_lint_and_then (
232232 cx,
233233 WRITE_WITH_NEWLINE ,
234- mac. span ,
234+ mac. span ( ) ,
235235 "using `write!()` with a format string that ends in a single newline" ,
236236 |err| {
237237 err. multipart_suggestion (
@@ -247,7 +247,7 @@ impl EarlyLintPass for Write {
247247 }
248248 }
249249 } 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 ) {
251251 if fmt_str. symbol == Symbol :: intern ( "" ) {
252252 let mut applicability = Applicability :: MachineApplicable ;
253253 let suggestion = expr. map_or_else (
@@ -261,7 +261,7 @@ impl EarlyLintPass for Write {
261261 span_lint_and_sugg (
262262 cx,
263263 WRITELN_EMPTY_STRING ,
264- mac. span ,
264+ mac. span ( ) ,
265265 format ! ( "using `writeln!({}, \" \" )`" , suggestion) . as_str ( ) ,
266266 "replace it with" ,
267267 format ! ( "writeln!({})" , suggestion) ,
0 commit comments