File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use if_chain::if_chain;
22use rustc_errors:: Applicability ;
33use rustc_hir:: { Expr , ExprKind , LangItem } ;
44use rustc_lint:: { LateContext , LateLintPass } ;
5- use rustc_middle:: ty:: TyS ;
5+ use rustc_middle:: { lint :: in_external_macro , ty:: TyS } ;
66use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
77
88use crate :: utils:: { is_type_lang_item, snippet_with_applicability, span_lint_and_sugg} ;
@@ -39,6 +39,10 @@ declare_lint_pass!(RedundantSlicing => [REDUNDANT_SLICING]);
3939
4040impl LateLintPass < ' _ > for RedundantSlicing {
4141 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
42+ if in_external_macro ( cx. sess , expr. span ) {
43+ return ;
44+ }
45+
4246 if_chain ! {
4347 if let ExprKind :: AddrOf ( _, _, addressee) = expr. kind;
4448 if let ExprKind :: Index ( indexed, range) = addressee. kind;
You can’t perform that action at this time.
0 commit comments