rust-lang / rust-lang/rust-clippy

ICE: byte index is not a char boundary

Open
#14,889 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-ICE
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Summary

Seems to be some issue with rustdoc resolving when building https://github.com/ScuffleCloud/scuffle/tree/main/crates/openapiv3_1 on the latest nightly.

Version
rustc 1.89.0-nightly (3e674b06b 2025-05-23)
binary: rustc
commit-hash: 3e674b06b5c74adea662bd0b0b06450757994b16
commit-date: 2025-05-23
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5
Error output

cargo +nightly clippy --fix --allow-dirty --allow-staged --all-features --all-targets -- -Aclippy::collapsible_if

Backtrace

thread 'rustc' panicked at compiler/rustc_resolve/src/rustdoc.rs:573:52:
byte index 5 is not a char boundary; it is inside '“' (bytes 4..7) of `/// “<https://spec.openapis.org/oas/3.1/dialect/base>”.`
stack backtrace:
 0:     0x7a5b754d9ee5 - std::backtrace::Backtrace::create::hfa425f8c6118c291
 1:     0x7a5b73958655 - std::backtrace::Backtrace::force_capture::hc89ba712c3edf9d4
 2:     0x7a5b7299b841 - std[dddea0bc0c38a8db]::panicking::update_hook::<alloc[ad07e7cbb7f1de4e]::boxed::Box<rustc_driver_impl[40f87d5870cfacca]::install_ice_hook::{closure#1}>>::{closure#0}
 3:     0x7a5b73972583 - std::panicking::rust_panic_with_hook::hedd3f60f85824998
 4:     0x7a5b7397227a - std::panicking::begin_panic_handler::{{closure}}::hf9de1d740cfa85c9
 5:     0x7a5b7396e779 - std::sys::backtrace::__rust_end_short_backtrace::h60f7d5e7789cd81b
 6:     0x7a5b73971f3d - __rustc[6241699db995e819]::rust_begin_unwind
 7:     0x7a5b70289ee0 - core::panicking::panic_fmt::h4e2563c759f41a6b
 8:     0x7a5b723133b8 - core::str::slice_error_fail_rt::ha36c98683684cf1f
 9:     0x7a5b71e5f45a - core::str::slice_error_fail::h161b850287570329
10:     0x7a5b73515e71 - rustc_resolve[7482c1cfbb429b3e]::rustdoc::source_span_for_markdown_range
11:     0x5c07c097fd90 - clippy_lints[e708863a9e139b61]::doc::check_doc::<pulldown_cmark[895084883fe8842d]::parse::OffsetIter<&mut clippy_lints[e708863a9e139b61]::doc::check_attrs::fake_broken_link_callback>>
12:     0x5c07c097d9f8 - <clippy_lints[e708863a9e139b61]::doc::Documentation as rustc_lint[89c7c922771d035e]::passes::LateLintPass>::check_attributes
13:     0x7a5b72efeec9 - <rustc_lint[89c7c922771d035e]::late::LateContextAndPass<rustc_lint[89c7c922771d035e]::late::RuntimeCombinedLateLintPass> as rustc_hir[3200d56c267c33f3]::intravisit::Visitor>::visit_nested_item
14:     0x7a5b74f28778 - rustc_lint[89c7c922771d035e]::late::check_crate::{closure#0}
15:     0x7a5b74f28a2b - rustc_lint[89c7c922771d035e]::late::check_crate
16:     0x7a5b74f2c39f - rustc_interface[3a0a2c43e50c5194]::passes::analysis
17:     0x7a5b74f2c175 - rustc_query_impl[31296628a992b875]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[31296628a992b875]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[39ac76d544e79577]::query::erase::Erased<[u8; 0usize]>>
18:     0x7a5b752cf6c4 - rustc_query_system[71c12886ffe7ba46]::query::plumbing::try_execute_query::<rustc_query_impl[31296628a992b875]::DynamicConfig<rustc_query_system[71c12886ffe7ba46]::query::caches::SingleCache<rustc_middle[39ac76d544e79577]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[31296628a992b875]::plumbing::QueryCtxt, true>
19:     0x7a5b752cefe8 - rustc_query_impl[31296628a992b875]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
20:     0x7a5b7512ae87 - rustc_interface[3a0a2c43e50c5194]::passes::create_and_enter_global_ctxt::<core[a1eebbb7364c739]::option::Option<rustc_interface[3a0a2c43e50c5194]::queries::Linker>, rustc_driver_impl[40f87d5870cfacca]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
21:     0x7a5b7511c60f - rustc_interface[3a0a2c43e50c5194]::interface::run_compiler::<(), rustc_driver_impl[40f87d5870cfacca]::run_compiler::{closure#0}>::{closure#1}
22:     0x7a5b750c5706 - std[dddea0bc0c38a8db]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[3a0a2c43e50c5194]::util::run_in_thread_with_globals<rustc_interface[3a0a2c43e50c5194]::util::run_in_thread_pool_with_globals<rustc_interface[3a0a2c43e50c5194]::interface::run_compiler<(), rustc_driver_impl[40f87d5870cfacca]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
23:     0x7a5b750c53ab - <<std[dddea0bc0c38a8db]::thread::Builder>::spawn_unchecked_<rustc_interface[3a0a2c43e50c5194]::util::run_in_thread_with_globals<rustc_interface[3a0a2c43e50c5194]::util::run_in_thread_pool_with_globals<rustc_interface[3a0a2c43e50c5194]::interface::run_compiler<(), rustc_driver_impl[40f87d5870cfacca]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[a1eebbb7364c739]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
24:     0x7a5b750c66fd - std::sys::pal::unix::thread::Thread::new::thread_start::h337190b46df16ff4
25:     0x7a5b6ec9caa4 - start_thread
                             at ./nptl/pthread_create.c:447:8
26:     0x7a5b6ed29c3c - clone3
                             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
27:                0x0 - <unknown>


rustc version: 1.89.0-nightly (3e674b06b 2025-05-23)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the ICE with the reported nightly version using the listed cargo clippy command and the ScuffleCloud openapiv3_1 crate. Start at compiler/rustc_resolve/src/rustdoc.rs:573 and inspect the rustdoc resolution path for the quoted URL containing curly quotation marks. Done means the command no longer panics on this input and the relevant regression is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.