Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc json ice: assertion failure: different Item visibility (Crate vs Public) #98006

Closed
matthiaskrgr opened this issue Jun 11, 2022 · 1 comment · Fixed by #98195
Closed
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

#![feature(no_core)]
#![no_core]

#[doc(primitive = "usize")]
/// This is the built-in type `usize`.
mod usize {
}

Meta

rustc --version --verbose:

rustdoc 1.63.0-nightly (c08b235a5 2022-06-11)
binary: rustdoc
commit-hash: c08b235a5ce10167632bb0fddcd0c5d67f2d42e3
commit-date: 2022-06-11
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5

Error output

rustdoc -Zunstable-options --output-format json --cap-lints warn --document-private-items ./src/test/rustdoc/auxiliary/primitive-doc.rs

<output>
Backtrace

warning: `doc(primitive)` should never have been stable
 --> ./src/test/rustdoc/auxiliary/primitive-doc.rs:6:7
  |
6 | #[doc(primitive = "usize")]
  |       ^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(invalid_doc_attributes)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:1:1445"), crate_id: 0, name: Some("usize"), span: Some(Span { filename: "./src/test/rustdoc/auxiliary/primitive-doc.rs", begin: (8, 0), end: (9, 1) }), visibility: Crate, docs: Some("This is the built-in type `usize`."), links: {}, attrs: ["#[doc(primitive = \"usize\")]"], deprecation: None, inner: Module(Module { is_crate: false, items: [] }) }`,
 right: `Item { id: Id("0:1:1445"), crate_id: 0, name: Some("usize"), span: Some(Span { filename: "./src/test/rustdoc/auxiliary/primitive-doc.rs", begin: (8, 0), end: (9, 1) }), visibility: Public, docs: Some("This is the built-in type `usize`."), links: {}, attrs: ["#[doc(primitive = \"usize\")]"], deprecation: None, inner: PrimitiveType("usize") }`', src/librustdoc/json/mod.rs:202:17
stack backtrace:
   0:     0x7f6627e9e24d - std::backtrace_rs::backtrace::libunwind::trace::hbda756d3a5f7793b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f6627e9e24d - std::backtrace_rs::backtrace::trace_unsynchronized::he406e69cad63dc23
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6627e9e24d - std::sys_common::backtrace::_print_fmt::haf02d0db8ce964ea
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f6627e9e24d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h593e23fa276ab7eb
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f6627efa03c - core::fmt::write::h15ae908cdc2b7057
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/core/src/fmt/mod.rs:1196:17
   5:     0x7f6627e8f9e1 - std::io::Write::write_fmt::hd05fda0f86262a57
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/io/mod.rs:1654:15
   6:     0x7f6627ea0f25 - std::sys_common::backtrace::_print::h56e00569a093de7b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f6627ea0f25 - std::sys_common::backtrace::print::h154890ec5be15427
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f6627ea0f25 - std::panicking::default_hook::{{closure}}::h956bfa0e86fe51f6
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:295:22
   9:     0x7f6627ea0c46 - std::panicking::default_hook::h6043872de872daf7
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:314:9
  10:     0x7f66286fac61 - rustc_driver[887956d0deaa6d7a]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f6627ea15fa - std::panicking::rust_panic_with_hook::h06a4e01a02150fc1
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:702:17
  12:     0x7f6627ea1437 - std::panicking::begin_panic_handler::{{closure}}::h376c0b0d176b15fb
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:588:13
  13:     0x7f6627e9e704 - std::sys_common::backtrace::__rust_end_short_backtrace::hb6064a5b72d04bd2
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f6627ea1169 - rust_begin_unwind
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:584:5
  15:     0x7f6627e66373 - core::panicking::panic_fmt::h18f352cc18da6352
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/core/src/panicking.rs:142:14
  16:     0x7f6627ef6de8 - core::panicking::assert_failed_inner::hc3f9e178e607f850
  17:     0x555e888c6174 - core[47d7e3b58a64b363]::panicking::assert_failed::<rustdoc_json_types[8c03fa6f039a8cd6]::Item, rustdoc_json_types[8c03fa6f039a8cd6]::Item>
  18:     0x555e88bc2780 - <rustdoc[325768d69b163fb7]::json::JsonRenderer as rustdoc[325768d69b163fb7]::formats::renderer::FormatRenderer>::item
  19:     0x555e88bbc4a9 - <rustdoc[325768d69b163fb7]::json::JsonRenderer as rustdoc[325768d69b163fb7]::formats::renderer::FormatRenderer>::item
  20:     0x555e88b37cca - rustdoc[325768d69b163fb7]::formats::renderer::run_format::<rustdoc[325768d69b163fb7]::json::JsonRenderer>
  21:     0x555e88911e32 - rustdoc[325768d69b163fb7]::run_renderer::<rustdoc[325768d69b163fb7]::json::JsonRenderer>
  22:     0x555e88b644bb - <rustc_session[350565c454728d1f]::session::Session>::time::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}::{closure#1}::{closure#2}>
  23:     0x555e88afdcc7 - <rustc_interface[823eb738556b78ea]::passes::QueryContext>::enter::<rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}::{closure#1}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  24:     0x555e88a0083a - <rustc_interface[823eb738556b78ea]::interface::Compiler>::enter::<rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  25:     0x555e88bfaaf6 - rustc_span[b519e1d6b7be61e8]::with_source_map::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustc_interface[823eb738556b78ea]::interface::create_compiler_and_run<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}>::{closure#1}>
  26:     0x555e88a29bc1 - rustc_interface[823eb738556b78ea]::interface::create_compiler_and_run::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}>
  27:     0x555e888dfb07 - <scoped_tls[dfe53452cd62d879]::ScopedKey<rustc_span[b519e1d6b7be61e8]::SessionGlobals>>::set::<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  28:     0x555e88a2ae7f - std[8de092468d8aceba]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[823eb738556b78ea]::util::run_in_thread_pool_with_globals<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  29:     0x555e88b19699 - <<std[8de092468d8aceba]::thread::Builder>::spawn_unchecked_<rustc_interface[823eb738556b78ea]::util::run_in_thread_pool_with_globals<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>::{closure#1} as core[47d7e3b58a64b363]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x7f6627eab523 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h68a1c90dcd11ebd9
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/alloc/src/boxed.rs:1951:9
  31:     0x7f6627eab523 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he92bdcacbb726b3b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/alloc/src/boxed.rs:1951:9
  32:     0x7f6627eab523 - std::sys::unix::thread::Thread::new::thread_start::hb6f32585ac3785d3
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys/unix/thread.rs:108:17
  33:     0x7f6627c7f54d - <unknown>
  34:     0x7f6627d04b14 - clone
  35:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.63.0-nightly (c08b235a5 2022-06-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options

query stack during panic:
end of query stack
warning: 1 warning emitted

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 11, 2022
@Enselic
Copy link
Member

Enselic commented Jun 12, 2022

@rustbot labels +A-rustdoc-json

@rustbot rustbot added the A-rustdoc-json Area: Rustdoc JSON backend label Jun 12, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jun 12, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 17, 2022
@bors bors closed this as completed in 4557ff7 Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants