Skip to content

rustdoc json ice: assertion failure: different Item.inner.id with --document-private-items --document-hidden-items #98007

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

#![crate_name = "foo"]

// This test ensures that there is no "infinite redirection" file generated (a
// file which redirects to itself).

// We check it's not a redirection file.
// @has 'foo/builders/struct.ActionRowBuilder.html'
// @has - '//*[@id="synthetic-implementations"]' 'Auto Trait Implementations'

// And that the link in the module is targetting it.
// @has 'foo/builders/index.html'
// @has - '//a[@href="struct.ActionRowBuilder.html"]' 'ActionRowBuilder'

mod auto {
    mod action_row {
        pub struct ActionRowBuilder;
    }

    #[doc(hidden)]
    pub mod builders {
        pub use super::action_row::ActionRowBuilder;
    }
}

pub use auto::*;

pub mod builders {
    pub use crate::auto::builders::*;
}

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 --document-hidden-items ./src/test/rustdoc/infinite-redirection.rs

<output>
Backtrace

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:7:1518"), crate_id: 0, name: Some("builders"), span: Some(Span { filename: "./src/test/rustdoc/infinite-redirection.rs", begin: (20, 4), end: (22, 5) }), visibility: Public, docs: None, links: {}, attrs: ["#[doc(hidden)]"], deprecation: None, inner: Module(Module { is_crate: false, items: [Id("0:8")] }) }`,
 right: `Item { id: Id("0:7:1518"), crate_id: 0, name: Some("builders"), span: Some(Span { filename: "./src/test/rustdoc/infinite-redirection.rs", begin: (20, 4), end: (22, 5) }), visibility: Public, docs: None, links: {}, attrs: ["#[doc(hidden)]"], deprecation: None, inner: Module(Module { is_crate: false, items: [Id("0:5:1517")] }) }`', src/librustdoc/json/mod.rs:202:17
stack backtrace:
   0:     0x7fbb7ee9e24d - std::backtrace_rs::backtrace::libunwind::trace::hbda756d3a5f7793b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fbb7ee9e24d - std::backtrace_rs::backtrace::trace_unsynchronized::he406e69cad63dc23
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fbb7ee9e24d - std::sys_common::backtrace::_print_fmt::haf02d0db8ce964ea
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fbb7ee9e24d - <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:     0x7fbb7eefa03c - core::fmt::write::h15ae908cdc2b7057
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/core/src/fmt/mod.rs:1196:17
   5:     0x7fbb7ee8f9e1 - std::io::Write::write_fmt::hd05fda0f86262a57
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/io/mod.rs:1654:15
   6:     0x7fbb7eea0f25 - std::sys_common::backtrace::_print::h56e00569a093de7b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fbb7eea0f25 - std::sys_common::backtrace::print::h154890ec5be15427
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fbb7eea0f25 - std::panicking::default_hook::{{closure}}::h956bfa0e86fe51f6
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:295:22
   9:     0x7fbb7eea0c46 - std::panicking::default_hook::h6043872de872daf7
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:314:9
  10:     0x7fbb7f6fac61 - rustc_driver[887956d0deaa6d7a]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fbb7eea15fa - std::panicking::rust_panic_with_hook::h06a4e01a02150fc1
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:702:17
  12:     0x7fbb7eea1437 - std::panicking::begin_panic_handler::{{closure}}::h376c0b0d176b15fb
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:588:13
  13:     0x7fbb7ee9e704 - std::sys_common::backtrace::__rust_end_short_backtrace::hb6064a5b72d04bd2
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7fbb7eea1169 - rust_begin_unwind
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:584:5
  15:     0x7fbb7ee66373 - core::panicking::panic_fmt::h18f352cc18da6352
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/core/src/panicking.rs:142:14
  16:     0x7fbb7eef6de8 - core::panicking::assert_failed_inner::hc3f9e178e607f850
  17:     0x55f8334c6174 - core[47d7e3b58a64b363]::panicking::assert_failed::<rustdoc_json_types[8c03fa6f039a8cd6]::Item, rustdoc_json_types[8c03fa6f039a8cd6]::Item>
  18:     0x55f8337c2780 - <rustdoc[325768d69b163fb7]::json::JsonRenderer as rustdoc[325768d69b163fb7]::formats::renderer::FormatRenderer>::item
  19:     0x55f8337bc4a9 - <rustdoc[325768d69b163fb7]::json::JsonRenderer as rustdoc[325768d69b163fb7]::formats::renderer::FormatRenderer>::item
  20:     0x55f833737cca - rustdoc[325768d69b163fb7]::formats::renderer::run_format::<rustdoc[325768d69b163fb7]::json::JsonRenderer>
  21:     0x55f833511e32 - rustdoc[325768d69b163fb7]::run_renderer::<rustdoc[325768d69b163fb7]::json::JsonRenderer>
  22:     0x55f8337644bb - <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:     0x55f8336fdcc7 - <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:     0x55f83360083a - <rustc_interface[823eb738556b78ea]::interface::Compiler>::enter::<rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  25:     0x55f8337faaf6 - 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:     0x55f833629bc1 - rustc_interface[823eb738556b78ea]::interface::create_compiler_and_run::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}>
  27:     0x55f8334dfb07 - <scoped_tls[dfe53452cd62d879]::ScopedKey<rustc_span[b519e1d6b7be61e8]::SessionGlobals>>::set::<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  28:     0x55f83362ae7f - 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:     0x55f833719699 - <<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:     0x7fbb7eeab523 - <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:     0x7fbb7eeab523 - <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:     0x7fbb7eeab523 - std::sys::unix::thread::Thread::new::thread_start::hb6f32585ac3785d3
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys/unix/thread.rs:108:17
  33:     0x7fbb7ec7f54d - <unknown>
  34:     0x7fbb7ed04b14 - 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-jsonArea: Rustdoc JSON backendC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions