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

Closed
@nathan-at-least

Description

@nathan-at-least

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...

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions