@@ -12,7 +12,7 @@ use rustc_lint::{LateContext, LateLintPass};
12
12
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
13
13
use rustc_span:: hygiene:: walk_chain;
14
14
use rustc_span:: source_map:: SourceMap ;
15
- use rustc_span:: { BytePos , Span , Symbol } ;
15
+ use rustc_span:: { sym , BytePos , Span , Symbol } ;
16
16
use std:: borrow:: Cow ;
17
17
18
18
declare_clippy_lint ! {
@@ -365,6 +365,21 @@ fn eq_stmts(
365
365
. all ( |b| get_stmt ( b) . map_or ( false , |s| eq. eq_stmt ( s, stmt) ) )
366
366
}
367
367
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
+
368
383
fn scan_block_for_eq ( cx : & LateContext < ' _ > , _conds : & [ & Expr < ' _ > ] , block : & Block < ' _ > , blocks : & [ & Block < ' _ > ] ) -> BlockEq {
369
384
let mut eq = SpanlessEq :: new ( cx) ;
370
385
let mut eq = eq. inter_expr ( ) ;
@@ -398,6 +413,7 @@ fn scan_block_for_eq(cx: &LateContext<'_>, _conds: &[&Expr<'_>], block: &Block<'
398
413
moved_locals,
399
414
} ;
400
415
}
416
+
401
417
let end_search_start = block. stmts [ start_end_eq..]
402
418
. iter ( )
403
419
. rev ( )
0 commit comments