Skip to content

Commit 872d09d

Browse files
authored
Unrolled build for rust-lang#138724
Rollup merge of rust-lang#138724 - fmease:list-stems-bear-no-name, r=nnethercote Check attrs: Don't try to retrieve the name of list stems Fixes rust-lang#138723. r? nnethercote or compiler
2 parents 5d85a71 + b5069da commit 872d09d

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
@@ -954,8 +954,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
954954
tcx.dcx().emit_err(errors::DocAliasBadLocation { span, attr_str, location });
955955
return;
956956
}
957-
let item_name = self.tcx.hir_name(hir_id);
958-
if item_name == doc_alias {
957+
if self.tcx.hir_opt_name(hir_id) == Some(doc_alias) {
959958
tcx.dcx().emit_err(errors::DocAliasNotAnAlias { span, attr_str });
960959
return;
961960
}
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)