avoid a Symbol to String conversion

This commit is contained in:
Takayuki Maeda 2022-07-20 18:19:25 +09:00
parent 9a7b7d5e50
commit 57a155b9fa
2 changed files with 2 additions and 4 deletions

View File

@ -1004,9 +1004,7 @@ fn lint_named_arguments_used_positionally(
node_id: ast::CRATE_NODE_ID, node_id: ast::CRATE_NODE_ID,
lint_id: LintId::of(&NAMED_ARGUMENTS_USED_POSITIONALLY), lint_id: LintId::of(&NAMED_ARGUMENTS_USED_POSITIONALLY),
diagnostic: BuiltinLintDiagnostics::NamedArgumentUsedPositionally( diagnostic: BuiltinLintDiagnostics::NamedArgumentUsedPositionally(
arg_span, arg_span, span, symbol,
span,
symbol.to_string(),
), ),
}); });
} }

View File

@ -467,7 +467,7 @@ pub enum BuiltinLintDiagnostics {
/// If true, the lifetime will be fully elided. /// If true, the lifetime will be fully elided.
use_span: Option<(Span, bool)>, 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 /// Lints that are buffered up early on in the `Session` before the