diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 420c002c5fc..a6a61ffc5da 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -359,7 +359,7 @@ impl CheckAttrVisitor<'tcx> { return false; } let item_name = self.tcx.hir().name(hir_id); - if item_name.to_string() == doc_alias { + if &*item_name.as_str() == doc_alias { self.tcx .sess .struct_span_err(