summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorRejyr <jerrylwang123@gmail.com>2022-08-19 19:52:20 -0400
committerRejyr <jerrylwang123@gmail.com>2022-08-22 08:24:14 -0400
commit6f83ec88e63b15f9cb34e63a5e149c5b826d6310 (patch)
treeae2c69b52212e1f42b137910718477560858e62b /compiler/rustc_lint/src
parent874a79fae30ec93bcd9847187741378c405bd9da (diff)
downloadrust-6f83ec88e63b15f9cb34e63a5e149c5b826d6310.tar.gz
rust-6f83ec88e63b15f9cb34e63a5e149c5b826d6310.zip
change: diagnostic `String` field to `Symbol`
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/errors.rs2
-rw-r--r--compiler/rustc_lint/src/levels.rs3
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<Span>,
-    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(()),
                         });