Skip to content

ICE in rustdoc redundant_explicit_links with non-ASCII link text #115064

Closed

Description

@kpreid

Code

Reduced from the source code of bumpalo 3.13.0:

/// [`…foo`] [`…bar`] [`Err`]
pub struct Broken {}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (5c6a7e71c 2023-08-20)
binary: rustc
commit-hash: 5c6a7e71cd66705c31c9af94077901a220f0870c
commit-date: 2023-08-20
host: x86_64-apple-darwin
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

thread 'rustc' panicked at src/librustdoc/passes/lint/redundant_explicit_links.rs:105:38:
byte index 2 is not a char boundary; it is inside '…' (bytes 1..4) of ``…foo``
Backtrace

thread 'rustc' panicked at src/librustdoc/passes/lint/redundant_explicit_links.rs:105:38:
byte index 2 is not a char boundary; it is inside '…' (bytes 1..4) of ``…foo``
stack backtrace:
   0:        0x10627bf0b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0a889342af22c001
   1:        0x1062dc77b - core::fmt::write::h2a9552489c640d30
   2:        0x10627098e - std::io::Write::write_fmt::h957f1bc49a89c995
   3:        0x10627bce9 - std::sys_common::backtrace::print::hd3ca24f2b09e2d6b
   4:        0x10627f3c8 - std::panicking::panic_hook_with_disk_dump::{{closure}}::hfdbd4926b1318eff
   5:        0x10627f090 - std::panicking::panic_hook_with_disk_dump::hff36df8bfb145345
   6:        0x114f89181 - rustc_driver_impl[271211c656e69f7c]::install_ice_hook::{closure#0}
   7:        0x10627fc10 - std::panicking::rust_panic_with_hook::h3d225d93354d6850
   8:        0x10627f9b3 - std::panicking::begin_panic_handler::{{closure}}::hfb6f37b7f59b8143
   9:        0x10627c3e9 - std::sys_common::backtrace::__rust_end_short_backtrace::h5cb50ae720fa1297
  10:        0x10627f6dd - _rust_begin_unwind
  11:        0x106308023 - core::panicking::panic_fmt::hda3b11d26a2996a0
  12:        0x1062e1595 - core::str::slice_error_fail_rt::hb64c0d7c400011f0
  13:        0x1063087b9 - core::str::slice_error_fail::h4ada315b265e1d30
  14:        0x104865f69 - rustdoc[7e76fc70b3a238cf]::passes::lint::redundant_explicit_links::visit_item
  15:        0x10483b8d7 - <rustdoc[7e76fc70b3a238cf]::passes::lint::Linter as rustdoc[7e76fc70b3a238cf]::visit::DocVisitor>::visit_item
  16:        0x10483b9bc - <rustdoc[7e76fc70b3a238cf]::passes::lint::Linter as rustdoc[7e76fc70b3a238cf]::visit::DocVisitor>::visit_item
  17:        0x10483b3f8 - rustdoc[7e76fc70b3a238cf]::passes::lint::run_lints
  18:        0x10476b05a - <rustc_session[aab8e8868057613]::session::Session>::time::<(rustdoc[7e76fc70b3a238cf]::clean::types::Crate, rustdoc[7e76fc70b3a238cf]::config::RenderOptions, rustdoc[7e76fc70b3a238cf]::formats::cache::Cache), rustdoc[7e76fc70b3a238cf]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  19:        0x10483e03b - <rustc_middle[110db10588286083]::ty::context::GlobalCtxt>::enter::<rustdoc[7e76fc70b3a238cf]::main_args::{closure#1}::{closure#0}::{closure#0}, core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>>
  20:        0x10477001c - <scoped_tls[14d6625b228cefa1]::ScopedKey<rustc_span[3fe5612a2015833b]::SessionGlobals>>::set::<rustc_interface[81a8130e43f77706]::interface::run_compiler<core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>, rustdoc[7e76fc70b3a238cf]::main_args::{closure#1}>::{closure#0}, core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>>
  21:        0x1049f9df3 - std[8dadf9e2e2548a40]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[81a8130e43f77706]::util::run_in_thread_pool_with_globals<rustc_interface[81a8130e43f77706]::interface::run_compiler<core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>, rustdoc[7e76fc70b3a238cf]::main_args::{closure#1}>::{closure#0}, core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>>
  22:        0x1049fa56e - <<std[8dadf9e2e2548a40]::thread::Builder>::spawn_unchecked_<rustc_interface[81a8130e43f77706]::util::run_in_thread_pool_with_globals<rustc_interface[81a8130e43f77706]::interface::run_compiler<core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>, rustdoc[7e76fc70b3a238cf]::main_args::{closure#1}>::{closure#0}, core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[cee64f789374d93]::result::Result<(), rustc_span[3fe5612a2015833b]::ErrorGuaranteed>>::{closure#1} as core[cee64f789374d93]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  23:        0x106289949 - std::sys::unix::thread::Thread::new::thread_start::h4626e4e0af234279
  24:     0x7ff817d4b4e1 - __pthread_start


rustc version: 1.74.0-nightly (5c6a7e71c 2023-08-20)
platform: x86_64-apple-darwin

query stack during panic:
end of query stack

Other notes

Would have been introduced by #113167 since that PR added the lint.. cc @ChAoSUnItY

@rustbot label -T-compiler +T-rustdoc

Activity

  1. 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 Aug 21, 2023
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    and removed
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Aug 21, 2023
  3. changed the title [-]ICE in rustdoc redundant_explicit_links with non-ASCII link text[/-] [+]ICE in rustdoc `redundant_explicit_links` with non-ASCII link text[/+] on Aug 21, 2023
  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Aug 22, 2023
  5. added a commit that references this issue on Aug 23, 2023
    c6f5495
  6. added a commit that references this issue on Sep 1, 2023
    20ddd45
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-rustdocRelevant to the rustdoc 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