@@ -2,8 +2,8 @@ use clippy_config::Conf;
22use clippy_utils:: diagnostics:: span_lint_and_then;
33use clippy_utils:: macros:: root_macro_call_first_node;
44use clippy_utils:: source:: snippet_opt;
5- use rustc_ast:: { AttrArgs , AttrArgsEq , AttrKind , Attribute , LitKind } ;
6- use rustc_hir:: { Expr , ExprKind } ;
5+ use rustc_ast:: { LitKind } ;
6+ use rustc_hir:: { Expr , ExprKind , Attribute , AttrArgs , AttrKind } ;
77use rustc_lint:: { LateContext , LateLintPass } ;
88use rustc_session:: impl_lint_pass;
99use rustc_span:: { Span , sym} ;
@@ -93,10 +93,10 @@ impl LateLintPass<'_> for LargeIncludeFile {
9393 if !attr. span . from_expansion ( )
9494 // Currently, rustc limits the usage of macro at the top-level of attributes,
9595 // so we don't need to recurse into each level.
96- && let AttrKind :: Normal ( ref normal ) = attr. kind
96+ && let AttrKind :: Normal ( ref item ) = attr. kind
9797 && let Some ( doc) = attr. doc_str ( )
9898 && doc. as_str ( ) . len ( ) as u64 > self . max_file_size
99- && let AttrArgs :: Eq { expr : AttrArgsEq :: Hir ( ref meta) , .. } = normal . item . args
99+ && let AttrArgs :: Eq { expr : meta, .. } = & item. args
100100 && !attr. span . contains ( meta. span )
101101 // Since the `include_str` is already expanded at this point, we can only take the
102102 // whole attribute snippet and then modify for our suggestion.
0 commit comments