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;
2
2
use rustc_errors:: Applicability ;
3
3
use rustc_hir:: { Expr , ExprKind , LangItem } ;
4
4
use rustc_lint:: { LateContext , LateLintPass } ;
5
- use rustc_middle:: ty:: TyS ;
5
+ use rustc_middle:: { lint :: in_external_macro , ty:: TyS } ;
6
6
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
7
7
8
8
use crate :: utils:: { is_type_lang_item, snippet_with_applicability, span_lint_and_sugg} ;
@@ -39,6 +39,10 @@ declare_lint_pass!(RedundantSlicing => [REDUNDANT_SLICING]);
39
39
40
40
impl LateLintPass < ' _ > for RedundantSlicing {
41
41
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
42
+ if in_external_macro ( cx. sess , expr. span ) {
43
+ return ;
44
+ }
45
+
42
46
if_chain ! {
43
47
if let ExprKind :: AddrOf ( _, _, addressee) = expr. kind;
44
48
if let ExprKind :: Index ( indexed, range) = addressee. kind;
You can’t perform that action at this time.
0 commit comments