]> git.lizzy.rs Git - rust.git/commitdiff
avoid a `Symbol` to `String` conversion
authorTakayuki Maeda <takoyaki0316@gmail.com>
Wed, 20 Jul 2022 09:19:25 +0000 (18:19 +0900)
committerTakayuki Maeda <takoyaki0316@gmail.com>
Wed, 20 Jul 2022 09:19:25 +0000 (18:19 +0900)
compiler/rustc_builtin_macros/src/format.rs
compiler/rustc_lint_defs/src/lib.rs

index 3b7e2102ffa9b6b47ace8dd62cc5ba0e890642aa..2d1fd81c32f86e87f851c0396da000908532cc9f 100644 (file)
@@ -1004,9 +1004,7 @@ fn lint_named_arguments_used_positionally(
                 node_id: ast::CRATE_NODE_ID,
                 lint_id: LintId::of(&NAMED_ARGUMENTS_USED_POSITIONALLY),
                 diagnostic: BuiltinLintDiagnostics::NamedArgumentUsedPositionally(
-                    arg_span,
-                    span,
-                    symbol.to_string(),
+                    arg_span, span, symbol,
                 ),
             });
         }
index 4fd57ed8533795502ec2a652822b6d0939a92a14..3872d866dee86ff455a0d39384271e6dffd79b70 100644 (file)
@@ -467,7 +467,7 @@ pub enum BuiltinLintDiagnostics {
         /// If true, the lifetime will be fully elided.
         use_span: Option<(Span, bool)>,
     },
-    NamedArgumentUsedPositionally(Option<Span>, Span, String),
+    NamedArgumentUsedPositionally(Option<Span>, Span, Symbol),
 }
 
 /// Lints that are buffered up early on in the `Session` before the