about summary refs log tree commit diff
path: root/compiler/rustc_lint_defs/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_lint_defs/src')
-rw-r--r--compiler/rustc_lint_defs/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs
index 7fdbae3a59d..b4069b317bf 100644
--- a/compiler/rustc_lint_defs/src/lib.rs
+++ b/compiler/rustc_lint_defs/src/lib.rs
@@ -249,7 +249,7 @@ impl Level {
 
     /// Converts an `Attribute` to a level.
     pub fn from_attr(attr: &impl AttributeExt) -> Option<(Self, Option<LintExpectationId>)> {
-        Self::from_symbol(attr.name_or_empty(), || Some(attr.id()))
+        attr.name().and_then(|name| Self::from_symbol(name, || Some(attr.id())))
     }
 
     /// Converts a `Symbol` to a level.