Skip to content

ICE in nightly rustdocs #111117

@jbr

Description

@jbr
Contributor

I'm not at all sure what the best way to reproduce this is, but here's an ICE in github actions.

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (a368898de 2023-05-02) running on x86_64-unknown-linux-gnu

Error output

assertion failed: event_range.start >= element.element_range.start &&
    event_range.end <= element.element_range.end

src/librustdoc/passes/lint/unescaped_backticks.rs:122:17
Backtrace

thread 'rustc' panicked at 'assertion failed: event_range.start >= element.element_range.start &&\n    event_range.end <= element.element_range.end', src/librustdoc/passes/lint/unescaped_backticks.rs:122:17
stack backtrace:
   0:     0x7f5466b02441 - std::backtrace_rs::backtrace::libunwind::trace::hfc6a5774a285598b
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f5466b02441 - std::backtrace_rs::backtrace::trace_unsynchronized::h072f54729cb03fbe
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5466b02441 - std::sys_common::backtrace::_print_fmt::h90cd72709[174](https://github.com/trillium-rs/trillium/actions/runs/4867382066/jobs/8679907423?pr=328#step:6:175)3039
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f5466b02441 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha69a7d6d7744182b
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f5466b630df - core::fmt::rt::Argument::fmt::h1c053c61e28a4a2c
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/core/src/fmt/rt.rs:138:9
   5:     0x7f5466b630df - core::fmt::write::h707e377e40255013
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f5466af54f1 - std::io::Write::write_fmt::h06bf41bbac8dfb21
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/io/mod.rs:1712:15
   7:     0x7f5466b02255 - std::sys_common::backtrace::_print::h02d5472e5e75dcdd
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f5466b02255 - std::sys_common::backtrace::print::haa13109f6fde1202
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f5466b04ee7 - std::panicking::default_hook::{{closure}}::ha0df47df6da4e474
  10:     0x7f5466b04cd4 - std::panicking::default_hook::hef982eb890cb84ba
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/panicking.rs:288:9
  11:     0x7f5469d36135 - <rustc_driver_impl[4568aa41b6df4bb4]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[c2d9ef320c5cdbe6]::ops::function::FnOnce<(&core[c2d9ef320c5cdbe6]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f5466b05607 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2c12bc3e2642362e
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/alloc/src/boxed.rs:1999:9
  13:     0x7f5466b05607 - std::panicking::rust_panic_with_hook::hdb4ce4a14cdedead
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/panicking.rs:695:13
  14:     0x7f5466b05341 - std::panicking::begin_panic_handler::{{closure}}::h94ea044a275497a3
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/panicking.rs:580:13
  15:     0x7f5466b02886 - std::sys_common::backtrace::__rust_end_short_backtrace::h6d526ec8e2ca61bd
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7f5466b050f2 - rust_begin_unwind
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/panicking.rs:578:5
  17:     0x7f5466b5f383 - core::panicking::panic_fmt::h1d9bb6eef5b05ff6
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/core/src/panicking.rs:67:14
  18:     0x7f5466b5f413 - core::panicking::panic::h01e600645e1c5217
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/core/src/panicking.rs:117:5
  19:     0x55c5af37e363 - rustdoc[c811262113fe42a3]::passes::lint::unescaped_backticks::visit_item
  20:     0x55c5af6aaba1 - <rustdoc[c811262113fe42a3]::passes::lint::Linter as rustdoc[c811262113fe42a3]::visit::DocVisitor>::visit_inner_recur
  21:     0x55c5af6aab68 - <rustdoc[c811262113fe42a3]::passes::lint::Linter as rustdoc[c811262113fe42a3]::visit::DocVisitor>::visit_inner_recur
  22:     0x55c5af6a9b3b - rustdoc[c811262113fe42a3]::passes::lint::run_lints
  23:     0x55c5af525982 - <rustc_session[595cde2573f90eb3]::session::Session>::time::<rustdoc[c811262113fe42a3]::clean::types::Crate, rustdoc[c811262113fe42a3]::core::run_global_ctxt::{closure#8}>
  24:     0x55c5af5dfb1a - rustdoc[c811262113fe42a3]::core::run_global_ctxt
  25:     0x55c5af525c01 - <rustc_session[595cde2573f90eb3]::session::Session>::time::<(rustdoc[c811262113fe42a3]::clean::types::Crate, rustdoc[c811262113fe42a3]::config::RenderOptions, rustdoc[c811262113fe42a3]::formats::cache::Cache), rustdoc[c811262113fe42a3]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  26:     0x55c5af62a263 - <rustc_middle[8bb1b9d153b3cf9c]::ty::context::GlobalCtxt>::enter::<rustdoc[c811262113fe42a3]::main_args::{closure#1}::{closure#0}::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>
  27:     0x55c5af388363 - <rustc_interface[c257fe2f1a1c32ae]::interface::Compiler>::enter::<rustdoc[c811262113fe42a3]::main_args::{closure#1}::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>
  28:     0x55c5af5f7226 - rustc_span[32e51960840ee4f9]::set_source_map::<core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>, rustc_interface[c257fe2f1a1c32ae]::interface::run_compiler<core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>, rustdoc[c811262113fe42a3]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  29:     0x55c5af66587a - <scoped_tls[892093b6a2[194](https://github.com/trillium-rs/trillium/actions/runs/4867382066/jobs/8679907423?pr=328#step:6:195)788]::ScopedKey<rustc_span[32e5[196](https://github.com/trillium-rs/trillium/actions/runs/4867382066/jobs/8679907423?pr=328#step:6:197)0840ee4f9]::SessionGlobals>>::set::<rustc_interface[c257fe2f1a1c32ae]::interface::run_compiler<core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>, rustdoc[c811262113fe42a3]::main_args::{closure#1}>::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>
  30:     0x55c5af53a409 - std[437e94ae58c7de88]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c257fe2f1a1c32ae]::util::run_in_thread_pool_with_globals<rustc_interface[c257fe2f1a1c32ae]::interface::run_compiler<core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>, rustdoc[c811262113fe42a3]::main_args::{closure#1}>::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>
  31:     0x55c5af5cf6a1 - <<std[437e94ae58c7de88]::thread::Builder>::spawn_unchecked_<rustc_interface[c257fe2f1a1c32ae]::util::run_in_thread_pool_with_globals<rustc_interface[c257fe2f1a1c32ae]::interface::run_compiler<core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>, rustdoc[c811262113fe42a3]::main_args::{closure#1}>::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c2d9ef320c5cdbe6]::result::Result<(), rustc_span[32e51960840ee4f9]::ErrorGuaranteed>>::{closure#1} as core[c2d9ef320c5cdbe6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  32:     0x7f5466b0fad5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h11b497427cc218d4
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/alloc/src/boxed.rs:[198](https://github.com/trillium-rs/trillium/actions/runs/4867382066/jobs/8679907423?pr=328#step:6:199)5:9
  33:     0x7f5466b0fad5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8bad4cdff0021bcf
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/alloc/src/boxed.rs:1985:9
  34:     0x7f5466b0fad5 - std::sys::unix::thread::Thread::new::thread_start::hcc4ebc7130a03170
                               at /rustc/a368898de758e1b8def6c9060044a5b40eb79e84/library/std/src/sys/unix/thread.rs:108:17
  35:     0x7f5466755b43 - <unknown>
  36:     0x7f54667e7a00 - <unknown>
  37:                0x0 - <unknown>

error: 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.71.0-nightly (a368898de [202](https://github.com/trillium-rs/trillium/actions/runs/4867382066/jobs/8679907423?pr=328#step:6:203)3-05-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

Activity

added
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.
on May 3, 2023
jbr

jbr commented on May 3, 2023

@jbr
ContributorAuthor

closing, probably duplicate of #110626 I believe this is a distinct issue, but possibly also related to unresolved doc links?

reopened this on May 3, 2023
lukas-code

lukas-code commented on May 3, 2023

@lukas-code
Member

reduced:

/// One-indexed, because the first CloneCounter is included. If you don't
/// want the original to count, construct a [``CloneCounterObserver`]
/// instead and use [`CloneCounterObserver::counter`] to increment.
pub struct CloneCounter;

pub struct CloneCounterObserver;

This looks like a bug in pulldown-cmark to me.

The following gets parsed as one single link (which is ok):

[``CloneCounterObserver`] instead and use [`CloneCounterObserver::counter`]

But the span (event range) of the link gets reported like this, which doesn't match the start and end tags of the link:

[``CloneCounterObserver`] instead and use [`CloneCounterObserver::counter`]
^^^^^^^^^^^^^^^^^^^^^^^^^

The start and end tags are inserted like this:

<a href="CloneCounterObserver">``CloneCounterObserver<code>] instead and use [</code>CloneCounterObserver::counter`</a>
added a commit that references this issue on May 25, 2023
b35b134
added a commit that references this issue on May 25, 2023
bd7e8b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @jbr@lukas-code

      Issue actions

        ICE in nightly rustdocs · Issue #111117 · rust-lang/rust