File tree 1 file changed +8
-0
lines changed
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]);
389
389
390
390
impl < ' tcx > LateLintPass < ' tcx > for StrToString {
391
391
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & Expr < ' _ > ) {
392
+ if expr. span . from_expansion ( ) {
393
+ return ;
394
+ }
395
+
392
396
if let ExprKind :: MethodCall ( path, self_arg, ..) = & expr. kind
393
397
&& path. ident . name == sym:: to_string
394
398
&& let ty = cx. typeck_results ( ) . expr_ty ( self_arg)
@@ -437,6 +441,10 @@ declare_lint_pass!(StringToString => [STRING_TO_STRING]);
437
441
438
442
impl < ' tcx > LateLintPass < ' tcx > for StringToString {
439
443
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & Expr < ' _ > ) {
444
+ if expr. span . from_expansion ( ) {
445
+ return ;
446
+ }
447
+
440
448
if let ExprKind :: MethodCall ( path, self_arg, ..) = & expr. kind
441
449
&& path. ident . name == sym:: to_string
442
450
&& let ty = cx. typeck_results ( ) . expr_ty ( self_arg)
You can’t perform that action at this time.
0 commit comments