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

assertion failure when building rustdoc json output for std #101926

Closed
tmandry opened this issue Sep 17, 2022 · 2 comments
Closed

assertion failure when building rustdoc json output for std #101926

tmandry opened this issue Sep 17, 2022 · 2 comments
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. 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

@tmandry
Copy link
Member

tmandry commented Sep 17, 2022

Commit: 1ec9b66 (beta branch)

$ RUSTDOCFLAGS=--output-format=json ./x.py doc library/std
Building rustbuild
    Finished dev [unoptimized] target(s) in 0.05s
Documenting stage0 std (aarch64-apple-darwin)
 Documenting core v0.0.0 (/Users/tmandry/code/rust-beta/library/core)
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:3423:123"), crate_id: 0, name: Some("Error"), span: Some(Span { filename: "library/core/src/convert/mod.rs", begin: (587, 4), end: (587, 26) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Typedef(Typedef { type_: QualifiedPath { name: "Error", args: AngleBracketed { args: [], bindings: [] }, self_type: Generic("U"), trait_: ResolvedPath { name: "TryFrom", id: Id("0:3394:212"), args: Some(AngleBracketed { args: [Type(Generic("T"))], bindings: [] }), param_names: [] } }, generics: Generics { params: [], where_predicates: [] } }) }`,
 right: `Item { id: Id("0:3423:123"), crate_id: 0, name: Some("Error"), span: Some(Span { filename: "library/core/src/convert/mod.rs", begin: (587, 4), end: (587, 26) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Typedef(Typedef { type_: QualifiedPath { name: "Error", args: AngleBracketed { args: [], bindings: [] }, self_type: Generic("U"), trait_: ResolvedPath { name: "", id: Id("0:3394:212"), args: None, param_names: [] } }, generics: Generics { params: [], where_predicates: [] } }) }`', src/librustdoc/json/mod.rs:234:21
Backtrace
stack backtrace:
   0:        0x1021d3fe0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h188b7ef1c7993e78
   1:        0x102225a54 - core::fmt::write::he84a3004e7af3f34
   2:        0x1021c70c0 - std::io::Write::write_fmt::h9370b50affaab0be
   3:        0x1021d6c24 - std::panicking::default_hook::{{closure}}::hc074f8023cce83ca
   4:        0x1021d698c - std::panicking::default_hook::hef854b51b9b79ff2
   5:        0x109644154 - rustc_driver[8d2050f8429f7bc4]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x1021d71f8 - std::panicking::rust_panic_with_hook::h1e59e224d558a492
   7:        0x1021d7090 - std::panicking::begin_panic_handler::{{closure}}::he1a9d6ab32bfd8c6
   8:        0x1021d44bc - std::sys_common::backtrace::__rust_end_short_backtrace::he9b94791b02f48cd
   9:        0x1021d6de8 - _rust_begin_unwind
  10:        0x102253968 - core::panicking::panic_fmt::h9fec86f6a9c4146e
  11:        0x1022229a4 - core::panicking::assert_failed_inner::hbff4c2e7ecf09c39
  12:        0x10119a9cc - core[bae5e8ef542d20e5]::panicking::assert_failed::<rustdoc_json_types[cd18b9bd74e3a3fb]::Item, rustdoc_json_types[cd18b9bd74e3a3fb]::Item>
  13:        0x100fca17c - <rustdoc[99c6693644e42dbb]::json::JsonRenderer as rustdoc[99c6693644e42dbb]::formats::renderer::FormatRenderer>::item
  14:        0x100fc57cc - <rustdoc[99c6693644e42dbb]::json::JsonRenderer as rustdoc[99c6693644e42dbb]::formats::renderer::FormatRenderer>::item
  15:        0x101064868 - <core[bae5e8ef542d20e5]::iter::adapters::map::Map<core[bae5e8ef542d20e5]::slice::iter::Iter<rustdoc[99c6693644e42dbb]::formats::Impl>, <rustdoc[99c6693644e42dbb]::json::JsonRenderer>::get_trait_implementors::{closure#0}::{closure#0}> as core[bae5e8ef542d20e5]::iter::traits::iterator::Iterator>::fold::<(), core[bae5e8ef542d20e5]::iter::traits::iterator::Iterator::for_each::call<rustdoc_json_types[cd18b9bd74e3a3fb]::Id, <alloc[60e9ff9c62c1e93b]::vec::Vec<rustdoc_json_types[cd18b9bd74e3a3fb]::Id> as alloc[60e9ff9c62c1e93b]::vec::spec_extend::SpecExtend<rustdoc_json_types[cd18b9bd74e3a3fb]::Id, core[bae5e8ef542d20e5]::iter::adapters::map::Map<core[bae5e8ef542d20e5]::slice::iter::Iter<rustdoc[99c6693644e42dbb]::formats::Impl>, <rustdoc[99c6693644e42dbb]::json::JsonRenderer>::get_trait_implementors::{closure#0}::{closure#0}>>>::spec_extend::{closure#0}>::{closure#0}>
  16:        0x100dec1e0 - <alloc[60e9ff9c62c1e93b]::vec::Vec<rustdoc_json_types[cd18b9bd74e3a3fb]::Id> as alloc[60e9ff9c62c1e93b]::vec::spec_from_iter::SpecFromIter<rustdoc_json_types[cd18b9bd74e3a3fb]::Id, core[bae5e8ef542d20e5]::iter::adapters::map::Map<core[bae5e8ef542d20e5]::slice::iter::Iter<rustdoc[99c6693644e42dbb]::formats::Impl>, <rustdoc[99c6693644e42dbb]::json::JsonRenderer>::get_trait_implementors::{closure#0}::{closure#0}>>>::from_iter
  17:        0x100fc7d08 - <rustdoc[99c6693644e42dbb]::json::JsonRenderer as rustdoc[99c6693644e42dbb]::formats::renderer::FormatRenderer>::item
  18:        0x100fc57cc - <rustdoc[99c6693644e42dbb]::json::JsonRenderer as rustdoc[99c6693644e42dbb]::formats::renderer::FormatRenderer>::item
  19:        0x100fc57cc - <rustdoc[99c6693644e42dbb]::json::JsonRenderer as rustdoc[99c6693644e42dbb]::formats::renderer::FormatRenderer>::item
  20:        0x100f66968 - rustdoc[99c6693644e42dbb]::formats::renderer::run_format::<rustdoc[99c6693644e42dbb]::json::JsonRenderer>
  21:        0x10105284c - rustdoc[99c6693644e42dbb]::run_renderer::<rustdoc[99c6693644e42dbb]::json::JsonRenderer>
  22:        0x100fd15c8 - <rustc_session[282d64e95cd3bf88]::session::Session>::time::<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustdoc[99c6693644e42dbb]::main_options::{closure#0}::{closure#0}::{closure#1}::{closure#2}>
  23:        0x100f30120 - <rustc_interface[db32075e2a9c594e]::passes::QueryContext>::enter::<rustdoc[99c6693644e42dbb]::main_options::{closure#0}::{closure#0}::{closure#1}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  24:        0x100ee3d30 - <rustc_interface[db32075e2a9c594e]::interface::Compiler>::enter::<rustdoc[99c6693644e42dbb]::main_options::{closure#0}::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  25:        0x100ffb1f8 - rustc_span[143ffa354e326ede]::with_source_map::<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_interface[db32075e2a9c594e]::interface::create_compiler_and_run<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustdoc[99c6693644e42dbb]::main_options::{closure#0}>::{closure#1}>
  26:        0x100f05a14 - rustc_interface[db32075e2a9c594e]::interface::create_compiler_and_run::<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustdoc[99c6693644e42dbb]::main_options::{closure#0}>
  27:        0x10102a554 - <scoped_tls[e8c526b3ddc66487]::ScopedKey<rustc_span[143ffa354e326ede]::SessionGlobals>>::set::<rustdoc[99c6693644e42dbb]::main_args::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  28:        0x100f15da4 - std[ad4c17a2ddbcabe2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[db32075e2a9c594e]::util::run_in_thread_pool_with_globals<rustdoc[99c6693644e42dbb]::main_args::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  29:        0x100f16af4 - <<std[ad4c17a2ddbcabe2]::thread::Builder>::spawn_unchecked_<rustc_interface[db32075e2a9c594e]::util::run_in_thread_pool_with_globals<rustdoc[99c6693644e42dbb]::main_args::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#1} as core[bae5e8ef542d20e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:        0x1021dfa5c - std::sys::unix::thread::Thread::new::thread_start::h7b2f9b83fb320a20
  31:        0x1aa2bc26c - __pthread_deallocate

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 (4b91a6ea7 2022-08-08) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -Z unstable-options -Z unstable-options -C symbol-mangling-version=legacy -Z unstable-options -Z unstable-options -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z force-unstable-if-unmarked

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

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

Caused by:
  process didn't exit successfully: `/Users/tmandry/code/rust-beta/build/bootstrap/debug/rustdoc --edition=2021 --crate-type lib --crate-name core library/core/src/lib.rs --target aarch64-apple-darwin -o /Users/tmandry/code/rust-beta/build/aarch64-apple-darwin/stage0-std/aarch64-apple-darwin/doc -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --markdown-css rust.css --markdown-no-toc -Z unstable-options --resource-suffix 1.64.0 --index-page /Users/tmandry/code/rust-beta/src/doc/index.md -C metadata=1c7d00ee3da5bbaa -L dependency=/Users/tmandry/code/rust-beta/build/aarch64-apple-darwin/stage0-std/aarch64-apple-darwin/release/deps -L dependency=/Users/tmandry/code/rust-beta/build/aarch64-apple-darwin/stage0-std/release/deps --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--check-cfg=values(freebsd12)' '--check-cfg=values(backtrace_in_libstd)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_os,"watchos")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","nvptx64","le32","xtensa")' '--check-cfg=values(dont_compile_me)' --output-format=json -Dwarnings '-Wrustdoc::invalid_codeblock_attributes' --crate-version 1.64.0-dev '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")'` (exit status: 101)
@tmandry tmandry added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. A-rustdoc-json Area: Rustdoc JSON backend requires-nightly This issue requires a nightly compiler in some way. labels Sep 17, 2022
@aDotInTheVoid
Copy link
Member

@rustbot modify label: +E-needs-mcve

@rustbot rustbot added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Sep 25, 2022
@aDotInTheVoid
Copy link
Member

It looks like the underlying issue (#97986) was fixed in #98053, but this isn't included in the version run because by default ./x.py doc uses stage0 rustdoc (ie beta/stable, not in tree). Using RUSTDOCFLAGS=--output-format=json ./x.py doc library/std --stage 1 fixes this

I think that means this can be closed

@rustbot modify label: -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 Sep 26, 2022
@tmandry tmandry closed this as completed Oct 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. 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

No branches or pull requests

3 participants