Skip to content

Commit dbeb506

Browse files
committed
rustdoc JSON: Fix ICE with pub extern crate self as <self_crate_name>
1 parent 75b7e52 commit dbeb506

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/librustdoc/json/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
209209
}
210210

211211
types::ItemEnum::Method(_)
212+
| types::ItemEnum::Module(_)
212213
| types::ItemEnum::AssocConst { .. }
213214
| types::ItemEnum::AssocType { .. }
214215
| types::ItemEnum::PrimitiveType(_) => true,
215-
types::ItemEnum::Module(_)
216-
| types::ItemEnum::ExternCrate { .. }
216+
types::ItemEnum::ExternCrate { .. }
217217
| types::ItemEnum::Import(_)
218218
| types::ItemEnum::StructField(_)
219219
| types::ItemEnum::Variant(_)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/100531>
2+
3+
#![feature(no_core)]
4+
#![no_core]
5+
6+
#![crate_name = "export_extern_crate_as_self"]
7+
8+
// ignore-tidy-linelength
9+
10+
// @is export_extern_crate_as_self.json "$.index[*][?(@.kind=='module')].name" \"export_extern_crate_as_self\"
11+
pub extern crate self as export_extern_crate_as_self; // Must be the same name as the crate already has

0 commit comments

Comments
 (0)