Skip to content

Commit 6f83ec8

Browse files
committed
change: diagnostic String field to Symbol
1 parent 874a79f commit 6f83ec8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

compiler/rustc_lint/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum MalformedAttributeSub {
2525
pub struct UnknownTool {
2626
#[primary_span]
2727
pub span: Option<Span>,
28-
pub tool_name: String,
28+
pub tool_name: Symbol,
2929
pub lint_name: String,
3030
#[help]
3131
pub is_nightly_build: Option<()>,

compiler/rustc_lint/src/levels.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ impl<'s> LintLevelsBuilder<'s> {
271271
self.cur = self.sets.list.push(LintSet { specs: FxHashMap::default(), parent: prev });
272272

273273
let sess = self.sess;
274-
// let bad_attr = |span| struct_span_err!(sess, span, E0452, "malformed lint attribute input");
275274
for (attr_index, attr) in attrs.iter().enumerate() {
276275
if attr.has_name(sym::automatically_derived) {
277276
self.current_specs_mut().insert(
@@ -500,7 +499,7 @@ impl<'s> LintLevelsBuilder<'s> {
500499
&CheckLintNameResult::NoTool => {
501500
sess.emit_err(UnknownTool {
502501
span: tool_ident.map(|ident| ident.span),
503-
tool_name: tool_name.unwrap().to_string(),
502+
tool_name: tool_name.unwrap(),
504503
lint_name: pprust::path_to_string(&meta_item.path),
505504
is_nightly_build: sess.is_nightly_build().then_some(()),
506505
});

0 commit comments

Comments
 (0)