Rollup merge of #100630 - Enselic:export_extern_crate_as_self, r=GuillaumeGomez

rustdoc JSON: Fix ICE with `pub extern crate self as <self_crate_name>`

Closes #100531

r? `@GuillaumeGomez`

`@rustbot` labels +A-rustdoc-json +T-rustdoc
This commit is contained in:
Takayuki Maeda 2022-08-17 05:08:05 +09:00 committed by GitHub
commit af74e7232f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -209,11 +209,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
}
types::ItemEnum::Method(_)
| types::ItemEnum::Module(_)
| types::ItemEnum::AssocConst { .. }
| types::ItemEnum::AssocType { .. }
| types::ItemEnum::PrimitiveType(_) => true,
types::ItemEnum::Module(_)
| types::ItemEnum::ExternCrate { .. }
types::ItemEnum::ExternCrate { .. }
| types::ItemEnum::Import(_)
| types::ItemEnum::StructField(_)
| types::ItemEnum::Variant(_)

View File

@ -0,0 +1,11 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/100531>
#![feature(no_core)]
#![no_core]
#![crate_name = "export_extern_crate_as_self"]
// ignore-tidy-linelength
// @is export_extern_crate_as_self.json "$.index[*][?(@.kind=='module')].name" \"export_extern_crate_as_self\"
pub extern crate self as export_extern_crate_as_self; // Must be the same name as the crate already has