Skip to content

Running cargo doc causes compiler to crash complaining it could not document nom #102631

Closed
@nazmulidris

Description

@nazmulidris

Code

cargo doc

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (57f097ea2 2022-10-01)
binary: rustc
commit-hash: 57f097ea25f2c05f424fc9b9dc50dbd6d399845c
commit-date: 2022-10-01
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.2

Error output

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 (57f097ea2 2022-10-01) 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
error: could not document `nom`

Caused by:
  process didn't exit successfully: `rustdoc --crate-type lib --crate-name nom /home/nazmul/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-4.2.3/src/lib.rs --cap-lints allow -o /home/nazmul/github/r3bl_rs_utils/target/doc --cfg 'feature="alloc"' --cfg 'feature="std"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=a97e2426bad123a7 -L dependency=/home/nazmul/github/r3bl_rs_utils/target/debug/deps --extern memchr=/home/nazmul/github/r3bl_rs_utils/target/debug/deps/libmemchr-3370c882cc960afe.rmeta --crate-version 4.2.3 --cfg stable_i128` (exit status: 101)
Backtrace

thread 'rustc' panicked at 'expected non-translatable diagnostic message', compiler/rustc_error_messages/src/lib.rs:348:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/57f097ea25f2c05f424fc9b9dc50dbd6d399845c/library/std/src/panicking.rs:556:5
   1: core::panicking::panic_fmt
             at /rustc/57f097ea25f2c05f424fc9b9dc50dbd6d399845c/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: <core::panic::unwind_safe::AssertUnwindSafe<<rustdoc::passes::check_code_block_syntax::SyntaxChecker>::check_rust_syntax::{closure#2}> as core::ops::function::FnOnce<()>>::call_once
  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_interface::passes::QueryContext>::enter::<rustdoc::main_options::{closure#0}::{closure#0}::{closure#1}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  17: <rustc_interface::interface::Compiler>::enter::<rustdoc::main_options::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  18: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustdoc::main_options::{closure#0}>::{closure#1}>
  19: rustdoc::main_options
  20: <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 (57f097ea2 2022-10-01) 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 termcolor v1.1.3
error: could not document `nom`

Caused by:
  process didn't exit successfully: `rustdoc --crate-type lib --crate-name nom /home/nazmul/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-4.2.3/src/lib.rs --cap-lints allow -o /home/nazmul/github/r3bl_rs_utils/target/doc --cfg 'feature="alloc"' --cfg 'feature="std"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=a97e2426bad123a7 -L dependency=/home/nazmul/github/r3bl_rs_utils/target/debug/deps --extern memchr=/home/nazmul/github/r3bl_rs_utils/target/debug/deps/libmemchr-3370c882cc960afe.rmeta --crate-version 4.2.3 --cfg stable_i128` (exit status: 101)

Metadata

Metadata

Assignees

No one assigned

    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