From 6f83ec88e63b15f9cb34e63a5e149c5b826d6310 Mon Sep 17 00:00:00 2001 From: Rejyr Date: Fri, 19 Aug 2022 19:52:20 -0400 Subject: [PATCH] change: diagnostic `String` field to `Symbol` --- compiler/rustc_lint/src/errors.rs | 2 +- compiler/rustc_lint/src/levels.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_lint/src/errors.rs b/compiler/rustc_lint/src/errors.rs index 679cfad4961..4738e8e82b6 100644 --- a/compiler/rustc_lint/src/errors.rs +++ b/compiler/rustc_lint/src/errors.rs @@ -25,7 +25,7 @@ pub enum MalformedAttributeSub { pub struct UnknownTool { #[primary_span] pub span: Option, - pub tool_name: String, + pub tool_name: Symbol, pub lint_name: String, #[help] pub is_nightly_build: Option<()>, diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 2dd4d2b34cc..07e9eab62f3 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -271,7 +271,6 @@ impl<'s> LintLevelsBuilder<'s> { self.cur = self.sets.list.push(LintSet { specs: FxHashMap::default(), parent: prev }); let sess = self.sess; - // let bad_attr = |span| struct_span_err!(sess, span, E0452, "malformed lint attribute input"); for (attr_index, attr) in attrs.iter().enumerate() { if attr.has_name(sym::automatically_derived) { self.current_specs_mut().insert( @@ -500,7 +499,7 @@ impl<'s> LintLevelsBuilder<'s> { &CheckLintNameResult::NoTool => { sess.emit_err(UnknownTool { span: tool_ident.map(|ident| ident.span), - tool_name: tool_name.unwrap().to_string(), + tool_name: tool_name.unwrap(), lint_name: pprust::path_to_string(&meta_item.path), is_nightly_build: sess.is_nightly_build().then_some(()), });