Skip to content

Commit b5069da

Browse files
committed
Check attrs: Don't try to retrieve the name of list stems
1 parent 1370611 commit b5069da

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

compiler/rustc_passes/src/check_attr.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
952952
tcx.dcx().emit_err(errors::DocAliasBadLocation { span, attr_str, location });
953953
return;
954954
}
955-
let item_name = self.tcx.hir_name(hir_id);
956-
if item_name == doc_alias {
955+
if self.tcx.hir_opt_name(hir_id) == Some(doc_alias) {
957956
tcx.dcx().emit_err(errors::DocAliasNotAnAlias { span, attr_str });
958957
return;
959958
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Check that we don't ICE on `#[doc(alias)]`es placed on use items with list stems.
2+
// issue: <https://github.com/rust-lang/rust/issues/138723>
3+
//@ check-pass
4+
5+
#[doc(alias = "empty")]
6+
pub use {};
7+
8+
#[doc(alias = "id")]
9+
pub use {std::convert::identity};
10+
11+
fn main() {}

0 commit comments

Comments
 (0)