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

ICE with rustdoc json backend #89097

Closed
weiznich opened this issue Sep 19, 2021 · 5 comments
Closed

ICE with rustdoc json backend #89097

weiznich opened this issue Sep 19, 2021 · 5 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

@weiznich
Copy link
Contributor

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
@weiznich weiznich added C-bug Category: This is a bug. 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. labels Sep 19, 2021
@Urgau
Copy link
Member

Urgau commented Sep 19, 2021

cc #83718

@camelid camelid added 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 Oct 12, 2021
@camelid camelid changed the title Rustdoc json backend ICE with rustdoc json backend Oct 12, 2021
@camelid camelid added A-rustdoc-json Area: Rustdoc JSON backend requires-nightly This issue requires a nightly compiler in some way. labels Oct 12, 2021
@CraftSpider
Copy link
Contributor

As of recent nightly, this no longer errors, and I believe is fully handled under the relevant test-cases. If there are no complaints, I'm going to mark this issue as resolved.

@weiznich
Copy link
Contributor Author

weiznich commented Feb 1, 2022

@CraftSpider As I see another ICE with the mentioned feature flags + the mentioned source (but other backtrace), should I open a new issue or post it here?

@CraftSpider
Copy link
Contributor

Feel free to post here if you think it may be the same issue. I just ran the provided Cargo.toml with the provided command line on rustc 1.60.0-nightly (08df8b81d 2022-01-30) and got no errors, so I'd like to know where your issue comes from.

@weiznich
Copy link
Contributor Author

weiznich commented Feb 2, 2022

@CraftSpider I've submitted a new issue (#93588) as this requires slightly different instructions.

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

4 participants