File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,9 @@ use rustc_lint::{LateContext, LateLintPass};
13
13
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
14
14
use rustc_span:: hygiene:: walk_chain;
15
15
use rustc_span:: source_map:: SourceMap ;
16
- use rustc_span:: { BytePos , Span , Symbol } ;
16
+ use rustc_span:: { sym , BytePos , Span , Symbol } ;
17
17
use std:: borrow:: Cow ;
18
18
19
- const ACCEPTABLE_MACRO : [ & str ; 2 ] = [ "todo" , "unimplemented" ] ;
20
-
21
19
declare_clippy_lint ! {
22
20
/// ### What it does
23
21
/// Checks for consecutive `if`s with the same condition.
@@ -394,7 +392,10 @@ fn acceptable_macro(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
394
392
if let ExprKind :: Call ( call_expr, _) = expr. kind
395
393
&& let ExprKind :: Path ( QPath :: Resolved ( None , path) ) = call_expr. kind
396
394
&& macro_backtrace ( path. span ) . any ( |macro_call| {
397
- ACCEPTABLE_MACRO . contains ( & cx. tcx . item_name ( macro_call. def_id ) . as_str ( ) )
395
+ matches ! (
396
+ & cx. tcx. get_diagnostic_name( macro_call. def_id) ,
397
+ Some ( sym:: todo_macro | sym:: unimplemented_macro)
398
+ )
398
399
} ) {
399
400
return true ;
400
401
}
You can’t perform that action at this time.
0 commit comments