Skip to content
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

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

Closed
kpreid opened this issue Aug 21, 2023 · 0 comments · Fixed by #115070
Closed

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

kpreid opened this issue Aug 21, 2023 · 0 comments · Fixed by #115070
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kpreid
Copy link
Contributor

kpreid commented Aug 21, 2023

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

@kpreid kpreid 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 Aug 21, 2023
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 21, 2023
@kpreid kpreid 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 Aug 21, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 22, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 23, 2023
…xplicit-links, r=GuillaumeGomez,ChAoSUnItY

rustdoc: use unicode-aware checks for redundant explicit link fastpath

Fixes rust-lang#115064
Fixes rust-lang#115062
Fixes rust-lang#115116
@bors bors closed this as completed in 3df9b4d Aug 23, 2023
cuviper pushed a commit to cuviper/rust that referenced this issue Sep 1, 2023
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-rustdoc Relevant to the rustdoc 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