Skip to content

Commit

Permalink
Rollup merge of rust-lang#100630 - Enselic:export_extern_crate_as_sel…
Browse files Browse the repository at this point in the history
…f, r=GuillaumeGomez

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

Closes rust-lang#100531

r? `@GuillaumeGomez`

`@rustbot` labels +A-rustdoc-json +T-rustdoc
  • Loading branch information
TaKO8Ki authored Aug 16, 2022
2 parents 033387a + dbeb506 commit af74e72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_)
Expand Down
11 changes: 11 additions & 0 deletions src/test/rustdoc-json/reexport/export_extern_crate_as_self.rs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit af74e72

Please sign in to comment.