@@ -12,7 +12,7 @@ use rustc_lint::{LateContext, LateLintPass};
1212use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
1313use rustc_span:: hygiene:: walk_chain;
1414use rustc_span:: source_map:: SourceMap ;
15- use rustc_span:: { BytePos , Span , Symbol } ;
15+ use rustc_span:: { sym , BytePos , Span , Symbol } ;
1616use std:: borrow:: Cow ;
1717
1818declare_clippy_lint ! {
@@ -365,6 +365,21 @@ fn eq_stmts(
365365 . all ( |b| get_stmt ( b) . map_or ( false , |s| eq. eq_stmt ( s, stmt) ) )
366366}
367367
368+ fn block_contains_todo_macro ( cx : & LateContext < ' _ > , block : & Block < ' _ > ) -> bool {
369+ dbg ! ( block) ;
370+ if let Some ( macro_def_id) = block. span . ctxt ( ) . outer_expn_data ( ) . macro_def_id {
371+ dbg ! ( macro_def_id) ;
372+ if let Some ( diagnostic_name) = cx. tcx . get_diagnostic_name ( macro_def_id) {
373+ dbg ! ( diagnostic_name) ;
374+ diagnostic_name == sym:: todo_macro
375+ } else {
376+ false
377+ }
378+ } else {
379+ false
380+ }
381+ }
382+
368383fn scan_block_for_eq ( cx : & LateContext < ' _ > , _conds : & [ & Expr < ' _ > ] , block : & Block < ' _ > , blocks : & [ & Block < ' _ > ] ) -> BlockEq {
369384 let mut eq = SpanlessEq :: new ( cx) ;
370385 let mut eq = eq. inter_expr ( ) ;
@@ -398,6 +413,7 @@ fn scan_block_for_eq(cx: &LateContext<'_>, _conds: &[&Expr<'_>], block: &Block<'
398413 moved_locals,
399414 } ;
400415 }
416+
401417 let end_search_start = block. stmts [ start_end_eq..]
402418 . iter ( )
403419 . rev ( )
0 commit comments