Skip to content

(Resolved by downgrade) internal compiler error: unexpected panic while running cargo doc on rustc 1.66.0-nightly (9c56d9d6f 2022-09-29) running on x86_64-unknown-linux-gnu on crate nom #102603

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

Closed
nathan-at-least opened this issue Oct 2, 2022 · 4 comments · Fixed by #102633
Assignees
Labels
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.

Comments

@nathan-at-least
Copy link

nathan-at-least commented Oct 2, 2022

Code

I have created a stand-alone crate on github which reliably reproduces the internal compiler error on my system. The readme in that crate includes rustup version as well as cargo --version from inside and outside the repo which has a rust-toolchain.toml.

This is recreated with:

  1. cargo new
  2. Editing rust-toolchain.toml with channel = "nightly-2022-09-30"
  3. Adding the dependencies from my original crate into Cargo.toml
  4. Running cargo doc

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (9c56d9d6f 2022-09-29)
binary: rustc
commit-hash: 9c56d9d6fec6262bbb1549cfe466a812ae2c6523
commit-date: 2022-09-29
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.0

Error output

$ RUST_BACKTRACE=1 cargo doc
 Documenting nom v5.1.2                                                                                                                                                                           
    Checking proc-macro-error v1.0.4                                                             
    Checking atty v0.2.14
    Checking heck v0.4.0                                                                         
 Documenting either v1.8.0
 Documenting heck v0.4.0                                                                         
 Documenting fnv v1.0.7
 Documenting os_str_bytes v6.3.0                                                                                                                                                                  
    Checking fastrand v1.8.0
    Checking strsim v0.10.0                                                                      
    Checking termcolor v1.1.3
    Checking remove_dir_all v0.5.3    
 Documenting ppv-lite86 v0.2.16
    Checking once_cell v1.15.0
thread 'rustc' panicked at 'expected non-translatable diagnostic message', compiler/rustc_error_messages/src/lib.rs:347:18
stack backtrace:         
   0: rust_begin_unwind
             at /rustc/9c56d9d6fec6262bbb1549cfe466a812ae2c6523/library/std/src/panicking.rs:556:5
   1: core::panicking::panic_fmt
             at /rustc/9c56d9d6fec6262bbb1549cfe466a812ae2c6523/library/core/src/panicking.rs:142:14
   2: <rustc_error_messages::DiagnosticMessage>::expect_str
   3: <rustdoc::passes::check_code_block_syntax::BufferEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic                                                                                
   4: <rustc_errors::HandlerInner>::emit_diagnostic                                                                                                                                               
   5: <rustc_errors::Handler>::emit_diagnostic                                                                                                                                                    
   6: <rustc_errors::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
   7: rustc_parse::parser::emit_unclosed_delims                                                  
   8: rustc_parse::parse_stream_from_source_str
   9: std::panicking::try::<bool, core::panic::unwind_safe::AssertUnwindSafe<<rustdoc::passes::check_code_block_syntax::SyntaxChecker>::check_rust_syntax::{closure#2}>>
  10: rustc_driver::catch_fatal_errors::<<rustdoc::passes::check_code_block_syntax::SyntaxChecker>::check_rust_syntax::{closure#2}, bool>
  11: <rustdoc::passes::check_code_block_syntax::SyntaxChecker as rustdoc::visit::DocVisitor>::visit_item
  12: <rustdoc::passes::check_code_block_syntax::SyntaxChecker as rustdoc::visit::DocVisitor>::visit_item
  13: rustdoc::passes::check_code_block_syntax::check_code_block_syntax
  14: <rustc_session::session::Session>::time::<rustdoc::clean::types::Crate, rustdoc::core::run_global_ctxt::{closure#7}>
  15: rustdoc::core::run_global_ctxt
  16: <rustc_session::session::Session>::time::<(rustdoc::clean::types::Crate, rustdoc::config::RenderOptions, rustdoc::formats::cache::Cache), rustdoc::main_options::{closure#0}::{closure#0}::{
closure#1}::{closure#0}>
  17: <rustc_interface::passes::QueryContext>::enter::<rustdoc::main_options::{closure#0}::{closure#0}::{closure#1}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  18: <rustc_interface::interface::Compiler>::enter::<rustdoc::main_options::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  19: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuara
nteed>, rustdoc::main_options::{closure#0}>::{closure#1}>
  20: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustdoc::main_options::{closure#0}>
  21: rustdoc::main_options
  22: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustdoc::main_args::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.66.0-nightly (9c56d9d6f 2022-09-29) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

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

query stack during panic:
end of query stack
 Documenting clap_lex v0.3.0
error: could not document `nom`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-type lib --crate-name nom /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-5.1.2/src/lib.rs --cap-lints allow -o /home/user/hack/rustc-internal-bug-nightly-2022-09-30-cargo-doc/target/doc --cfg 'feature="alloc"' --cfg 'feature="std"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=b51d37cca3770787 -L dependency=/home/user/hack/rustc-internal-bug-nightly-2022-09-30-cargo-doc/target/debug/deps --extern memchr=/home/user/hack/rustc-internal-bug-nightly-2022-09-30-cargo-doc/target/debug/deps/libmemchr-7dfca3eeb657d49f.rmeta --crate-version 5.1.2 --cfg stable_i128` (exit status: 101)
warning: build failed, waiting for other jobs to finish...
@nathan-at-least nathan-at-least 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 Oct 2, 2022
@nathan-at-least
Copy link
Author

Note, changing rust-toolchain.toml to channel = "nightly" enables cargo doc to succeed with version:

$ rustc --version --verbose
rustc 1.65.0-nightly (17cbdfd07 2022-09-13)
binary: rustc
commit-hash: 17cbdfd07178349d0a3cecb8e7dde8f915666ced
commit-date: 2022-09-13
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

-and:

$ cargo --version --verbose
cargo 1.65.0-nightly (646e9a0b9 2022-09-02)
release: 1.65.0-nightly
commit-hash: 646e9a0b9ea8354cc409d05f10e8dc752c5de78e
commit-date: 2022-09-02
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Debian 11 (bullseye) [64-bit]

@nathan-at-least nathan-at-least changed the title internal compiler error: unexpected panic while running cargo doc on rustc 1.66.0-nightly (9c56d9d6f 2022-09-29) running on x86_64-unknown-linux-gnu on crate nom (Resolved by upgrade to newer nightly) internal compiler error: unexpected panic while running cargo doc on rustc 1.66.0-nightly (9c56d9d6f 2022-09-29) running on x86_64-unknown-linux-gnu on crate nom Oct 2, 2022
@nathan-at-least nathan-at-least changed the title (Resolved by upgrade to newer nightly) internal compiler error: unexpected panic while running cargo doc on rustc 1.66.0-nightly (9c56d9d6f 2022-09-29) running on x86_64-unknown-linux-gnu on crate nom (Resolved by downgrade) internal compiler error: unexpected panic while running cargo doc on rustc 1.66.0-nightly (9c56d9d6f 2022-09-29) running on x86_64-unknown-linux-gnu on crate nom Oct 2, 2022
@Noratrieb
Copy link
Member

@rustbot claim

@nazmulidris
Copy link

I'm also getting a similar error but mine doesn't resolve by changing channel = "nightly" in rust-toolchain.toml. More info: #102631

@Noratrieb
Copy link
Member

This issue here is caused by nom as well. The fix is pretty simple, I should be able to open up the PR today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants