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 with pub extern crate self as <self_crate_name> #100531

Closed
Enselic opened this issue Aug 14, 2022 · 1 comment · Fixed by #100630
Closed

rustdoc JSON ICE with pub extern crate self as <self_crate_name> #100531

Enselic opened this issue Aug 14, 2022 · 1 comment · Fixed by #100630
Labels
A-rustdoc-json Area: Rustdoc JSON backend I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Enselic
Copy link
Member

Enselic commented Aug 14, 2022

Found via #99919 (comment) and seems like a different issue than #100529

Step-by-step:

  1. cd /tmp
  2. curl -L https://crates.io/api/v1/crates/easy_proc/0.2.0/download | tar -xz
  3. cd easy_proc-0.2.0
  4. cargo +nightly rustdoc --lib -- -Z unstable-options --output-format json with rustdoc 1.65.0-nightly (75b7e52e9 2022-08-13)

Expected

rustdoc JSON is built

Actual

/tmp/easy_proc-0.2.0
% cargo +nightly rustdoc --lib -- -Z unstable-options --output-format json
 Documenting easy_proc v0.2.0 (/tmp/easy_proc-0.2.0)
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:0:1568"), crate_id: 0, name: Some("easy_proc"), span: Some(Span { filename: "src/lib.rs", begin: (1, 0), end: (35, 1) }), visibility: Public, docs: None, links: {}, attrs: [], deprecation: None, inner: ExternCrate { name: "easy_proc", rename: Some("self") } }`,
 right: `Item { id: Id("0:0:1568"), crate_id: 0, name: Some("easy_proc"), span: Some(Span { filename: "src/lib.rs", begin: (1, 0), end: (35, 1) }), visibility: Public, docs: Some("Helpers for making proc macro crates"), links: {}, attrs: ["#![warn(missing_docs, unused_import_braces, clippy :: pedantic,\nmissing_debug_implementations)]"], deprecation: None, inner: Module(Module { is_crate: true, items: [Id("0:0:1568"), Id("0:7"), Id("0:14"), Id("0:17"), Id("0:20"), Id("0:23:1578"), Id("0:25:1584")], is_stripped: false }) }`', src/librustdoc/json/mod.rs:243:21
stack backtrace:
   0:     0x7fd3eca101f0 - std::backtrace_rs::backtrace::libunwind::trace::h0ad3ea1f295943fa
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fd3eca101f0 - std::backtrace_rs::backtrace::trace_unsynchronized::h3d735ea737b7cb6f
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd3eca101f0 - std::sys_common::backtrace::_print_fmt::hfbffa4aad48cf418
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fd3eca101f0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha738a84a6d451bf0
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fd3eca6b2be - core::fmt::write::h8417ef24f00d0b21
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/core/src/fmt/mod.rs:1202:17
   5:     0x7fd3eca00f05 - std::io::Write::write_fmt::h3e7ec06f2b377bbe
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/io/mod.rs:1672:15
   6:     0x7fd3eca12eb3 - std::sys_common::backtrace::_print::h7befeffc780b8cec
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fd3eca12eb3 - std::sys_common::backtrace::print::haf96690800a3a335
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fd3eca12eb3 - std::panicking::default_hook::{{closure}}::h1ac2b0dba5bc8279
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/panicking.rs:295:22
   9:     0x7fd3eca12b9f - std::panicking::default_hook::h7348babc6f3f8e11
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/panicking.rs:314:9
  10:     0x7fd3ef251184 - <rustc_driver[8e6a5299f9cc0d8]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[104d4c2fa3822a9e]::ops::function::FnOnce<(&core[104d4c2fa3822a9e]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fd3eca136ed - std::panicking::rust_panic_with_hook::hc4945fbcea3150e8
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/panicking.rs:702:17
  12:     0x7fd3eca13547 - std::panicking::begin_panic_handler::{{closure}}::h585f395f8e9063ac
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/panicking.rs:588:13
  13:     0x7fd3eca106fc - std::sys_common::backtrace::__rust_end_short_backtrace::hf45c20ce028cb9f2
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7fd3eca13262 - rust_begin_unwind
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/panicking.rs:584:5
  15:     0x7fd3eca67dd3 - core::panicking::panic_fmt::hba397905ae8201a3
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/core/src/panicking.rs:142:14
  16:     0x7fd3eca67fbb - core::panicking::assert_failed_inner::hfc859626dcf15636
  17:     0x56287243a24b - core[104d4c2fa3822a9e]::panicking::assert_failed::<rustdoc_json_types[6fb1e2c5ce75c474]::Item, rustdoc_json_types[6fb1e2c5ce75c474]::Item>
  18:     0x5628725273dc - <rustdoc[da35cc98693c420e]::json::JsonRenderer as rustdoc[da35cc98693c420e]::formats::renderer::FormatRenderer>::item
  19:     0x56287269af6e - rustdoc[da35cc98693c420e]::formats::renderer::run_format::<rustdoc[da35cc98693c420e]::json::JsonRenderer>
  20:     0x5628723ef5d2 - rustdoc[da35cc98693c420e]::run_renderer::<rustdoc[da35cc98693c420e]::json::JsonRenderer>
  21:     0x5628726b4d68 - <rustc_session[2ec63f124a1a20e1]::session::Session>::time::<core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>, rustdoc[da35cc98693c420e]::main_options::{closure#0}::{closure#0}::{closure#1}::{closure#2}>
  22:     0x5628725e5538 - <rustc_interface[3f0e16ab3f9f028a]::passes::QueryContext>::enter::<rustdoc[da35cc98693c420e]::main_options::{closure#0}::{closure#0}::{closure#1}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>
  23:     0x5628724d1999 - <rustc_interface[3f0e16ab3f9f028a]::interface::Compiler>::enter::<rustdoc[da35cc98693c420e]::main_options::{closure#0}::{closure#0}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>
  24:     0x56287270ff11 - rustc_span[9601ff5af35df49b]::with_source_map::<core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>, rustc_interface[3f0e16ab3f9f028a]::interface::create_compiler_and_run<core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>, rustdoc[da35cc98693c420e]::main_options::{closure#0}>::{closure#1}>
  25:     0x56287250168c - rustc_interface[3f0e16ab3f9f028a]::interface::create_compiler_and_run::<core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>, rustdoc[da35cc98693c420e]::main_options::{closure#0}>
  26:     0x5628723f2a70 - rustdoc[da35cc98693c420e]::main_options
  27:     0x5628725e269c - <scoped_tls[a483a1011af12e7b]::ScopedKey<rustc_span[9601ff5af35df49b]::SessionGlobals>>::set::<rustdoc[da35cc98693c420e]::main_args::{closure#0}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>
  28:     0x562872679470 - std[e1c98a26831e884c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3f0e16ab3f9f028a]::util::run_in_thread_pool_with_globals<rustdoc[da35cc98693c420e]::main_args::{closure#0}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>::{closure#0}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>
  29:     0x5628725099d8 - <<std[e1c98a26831e884c]::thread::Builder>::spawn_unchecked_<rustc_interface[3f0e16ab3f9f028a]::util::run_in_thread_pool_with_globals<rustdoc[da35cc98693c420e]::main_args::{closure#0}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>::{closure#0}, core[104d4c2fa3822a9e]::result::Result<(), rustc_errors[f2be49721dffa37f]::ErrorGuaranteed>>::{closure#1} as core[104d4c2fa3822a9e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x7fd3eca1d4e3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hda2f928af025a78b
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/alloc/src/boxed.rs:1935:9
  31:     0x7fd3eca1d4e3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9bd78ed494fef80b
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/alloc/src/boxed.rs:1935:9
  32:     0x7fd3eca1d4e3 - std::sys::unix::thread::Thread::new::thread_start::h1972473febc5ebc9
                               at /rustc/75b7e52e92c3b00fc891b47f5b2efdff0a2be55a/library/std/src/sys/unix/thread.rs:108:17
  33:     0x7fd3ec766e2d - start_thread
                               at /usr/src/debug/glibc-2.35-15.fc36.x86_64/nptl/pthread_create.c:442:8
  34:     0x7fd3ec7ec1b0 - __clone3
                               at /usr/src/debug/glibc-2.35-15.fc36.x86_64/misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  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.65.0-nightly (75b7e52e9 2022-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z unstable-options

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not document `easy_proc`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name easy_proc src/lib.rs -o /tmp/easy_proc-0.2.0/target/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -Z unstable-options --output-format json -C metadata=7a660b5c1b5e3fb9 -L dependency=/tmp/easy_proc-0.2.0/target/debug/deps --extern easy_proc_common=/tmp/easy_proc-0.2.0/target/debug/deps/libeasy_proc_common-b09d45d815963389.rmeta --extern easy_proc_derive=/tmp/easy_proc-0.2.0/target/debug/deps/libeasy_proc_derive-ca70e8f1123288ee.so --extern proc_macro_error=/tmp/easy_proc-0.2.0/target/debug/deps/libproc_macro_error-bdde941bd22e6c24.rmeta --extern proc_macro2=/tmp/easy_proc-0.2.0/target/debug/deps/libproc_macro2-826d9fe5d75d7d62.rmeta --extern quote=/tmp/easy_proc-0.2.0/target/debug/deps/libquote-facff5a4f99a0f13.rmeta --extern syn=/tmp/easy_proc-0.2.0/target/debug/deps/libsyn-e7f5ff5262e5bd46.rmeta --crate-version 0.2.0` (exit status: 101)

@rustbot labels +A-rustdoc-json +T-rustdoc +I-ICE +requires-nightly +E-needs-mcve

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 14, 2022
@aDotInTheVoid
Copy link
Member

MCVE:

pub extern crate self as easy_proc;

@rustbot modify labels: -E-needs-mcve

@rustbot rustbot removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 14, 2022
@Enselic Enselic changed the title rustdoc JSON ICE with easy_proc 0.2.0 rustdoc JSON ICE with pub extern crate self as <self_crate_name> Aug 14, 2022
@bors bors closed this as completed in af74e72 Aug 16, 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 I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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.

3 participants