File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -389,6 +389,10 @@ declare_lint_pass!(StrToString => [STR_TO_STRING]);
389389
390390impl < ' tcx > LateLintPass < ' tcx > for StrToString {
391391 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & Expr < ' _ > ) {
392+ if expr. span . from_expansion ( ) {
393+ return ;
394+ }
395+
392396 if let ExprKind :: MethodCall ( path, self_arg, ..) = & expr. kind
393397 && path. ident . name == sym:: to_string
394398 && let ty = cx. typeck_results ( ) . expr_ty ( self_arg)
@@ -437,6 +441,10 @@ declare_lint_pass!(StringToString => [STRING_TO_STRING]);
437441
438442impl < ' tcx > LateLintPass < ' tcx > for StringToString {
439443 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & Expr < ' _ > ) {
444+ if expr. span . from_expansion ( ) {
445+ return ;
446+ }
447+
440448 if let ExprKind :: MethodCall ( path, self_arg, ..) = & expr. kind
441449 && path. ident . name == sym:: to_string
442450 && let ty = cx. typeck_results ( ) . expr_ty ( self_arg)
You can’t perform that action at this time.
0 commit comments