Skip to content

ICE with rustdoc json backend  #89097

Closed
Closed
@weiznich

Description

@weiznich

Code

[package]
name = "json_backend_bug"
version = "0.1.0"
authors = ["Georg Semmler <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
diesel = "1.4.7"

Running RUSTDOCFLAGS='-Z unstable-options --output-format=json' cargo +nightly doc an a crate with the dependencies listed above triggers a assertion in rustdoc:

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:3511"), crate_id: 0, name: Some("span"), span: Some(Span { filename: "/home/weiznich/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.76/src/spanned.rs", begin: (111, 4), end: (113, 5) }), visibility: Public, docs: None, links: {}, attrs: [], deprecation: None, inner: Method(Method { decl: FnDecl { inputs: [("", BorrowedRef { lifetime: None, mutable: false, type_: Generic("Self") })], output: Some(ResolvedPath { name: "Span", id: Id("21:909"), args: Some(AngleBracketed { args: [], bindings: [] }), param_names: [] }), c_variadic: false }, generics: Generics { params: [], where_predicates: [] }, header: {}, abi: "\"Rust\"", has_body: true }) }`,
 right: `Item { id: Id("0:3511"), crate_id: 0, name: Some("span"), span: Some(Span { filename: "/home/weiznich/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.76/src/spanned.rs", begin: (111, 4), end: (113, 5) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Method(Method { decl: FnDecl { inputs: [("self", BorrowedRef { lifetime: None, mutable: false, type_: Generic("Self") })], output: Some(ResolvedPath { name: "Span", id: Id("21:909"), args: Some(AngleBracketed { args: [], bindings: [] }), param_names: [] }), c_variadic: false }, generics: Generics { params: [], where_predicates: [] }, header: {}, abi: "\"Rust\"", has_body: true }) }`', src/librustdoc/json/mod.rs:179:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/aa8f2d432b23575929a48f87b8746f41ba723318/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/aa8f2d432b23575929a48f87b8746f41ba723318/library/core/src/panicking.rs:103:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   5: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   6: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   7: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   8: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   9: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
  10: rustdoc::formats::renderer::run_format
  11: rustc_session::utils::<impl rustc_session::session::Session>::time
  12: rustc_interface::passes::QueryContext::enter
  13: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  14: rustc_span::with_source_map
  15: rustc_interface::interface::create_compiler_and_run
  16: rustdoc::main_options
  17: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

Meta

rustc --version --verbose:

rustc 1.57.0-nightly (aa8f2d432 2021-09-18)
binary: rustc
commit-hash: aa8f2d432b23575929a48f87b8746f41ba723318
commit-date: 2021-09-18
host: x86_64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0

rustdoc --version --verbose

rustdoc 1.57.0-nightly (aa8f2d432 2021-09-18)
binary: rustdoc
commit-hash: aa8f2d432b23575929a48f87b8746f41ba723318
commit-date: 2021-09-18
host: x86_64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0

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.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions