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};
1313use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
1414use rustc_span:: hygiene:: walk_chain;
1515use rustc_span:: source_map:: SourceMap ;
16- use rustc_span:: { BytePos , Span , Symbol } ;
16+ use rustc_span:: { sym , BytePos , Span , Symbol } ;
1717use std:: borrow:: Cow ;
1818
19- const ACCEPTABLE_MACRO : [ & str ; 2 ] = [ "todo" , "unimplemented" ] ;
20-
2119declare_clippy_lint ! {
2220 /// ### What it does
2321 /// Checks for consecutive `if`s with the same condition.
@@ -394,7 +392,10 @@ fn acceptable_macro(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
394392 if let ExprKind :: Call ( call_expr, _) = expr. kind
395393 && let ExprKind :: Path ( QPath :: Resolved ( None , path) ) = call_expr. kind
396394 && 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+ )
398399 } ) {
399400 return true ;
400401 }
You can’t perform that action at this time.
0 commit comments