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

cargo doc => thread 'rustc' panicks with "byte index 2 is not a char boundary ..." on nightly #115116

Closed
lrieb opened this issue Aug 22, 2023 · 3 comments · Fixed by #115070
Closed
Labels
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.

Comments

@lrieb
Copy link

lrieb commented Aug 22, 2023

Code

The error only appears on nightly.

steps to reproduce:

cargo init                    # or cargo init --lib
cargo add axum       # this crate caused the error
cargo doc

rustc --version --verbose:

rustc 1.74.0-nightly (ef85656a1 2023-08-21)
binary: rustc
commit-hash: ef85656a10657ba5e4f7fe2931a4ca6293138d51
commit-date: 2023-08-21
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

cargo version --verbose

cargo 1.74.0-nightly (80eca0e58 2023-08-19)
release: 1.74.0-nightly
commit-hash: 80eca0e58fb2ff52c1e94fc191b55b37ed73e0e4
commit-date: 2023-08-19
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.2 vendored)
libcurl: 8.2.1-DEV (sys:0.4.65+curl-8.2.1 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Fedora 37.0.0 [64-bit]

Error output

Documenting axum v0.6.20
thread 'rustc' panicked at src/librustdoc/passes/collect_intra_doc_links.rs:1446:33:
byte index 2 is not a char boundary; it is inside '“' (bytes 0..3) of `“extractors”`
stack backtrace:
   0: rust_begin_unwind
             at /rustc/ef85656a10657ba5e4f7fe2931a4ca6293138d51/library/std/src/panicking.rs:617:5
   1: core::panicking::panic_fmt
             at /rustc/ef85656a10657ba5e4f7fe2931a4ca6293138d51/library/core/src/panicking.rs:67:14
   2: core::str::slice_error_fail_rt
   3: core::str::slice_error_fail
             at /rustc/ef85656a10657ba5e4f7fe2931a4ca6293138d51/library/core/src/str/mod.rs:87:9
   4: <rustdoc::passes::collect_intra_doc_links::LinkCollector>::resolve_links
   5: rustdoc::passes::collect_intra_doc_links::collect_intra_doc_links
   6: <rustc_session::session::Session>::time::<(rustdoc::clean::types::Crate, rustdoc::config::RenderOptions, rustdoc::formats::cache::Cache), rustdoc::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
   7: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustdoc::main_args::{closure#1}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
   8: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustdoc::main_args::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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-rustdoc&template=ice.md

note: please attach the file at `/home/luk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.20/rustc-ice-2023-08-22T21:28:21.787458591Z-17768.txt` to your bug report

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 `axum`

Caused by:
  process didn't exit successfully: `/home/luk/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustdoc --edition=2021 --crate-type lib --crate-name axum /home/luk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.20/src/lib.rs --cap-lints allow -o /home/luk/code/target/doc --cfg 'feature="default"' --cfg 'feature="form"' --cfg 'feature="http1"' --cfg 'feature="json"' --cfg 'feature="matched-path"' --cfg 'feature="original-uri"' --cfg 'feature="query"' --cfg 'feature="tokio"' --cfg 'feature="tower-log"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=174 -C metadata=6a2b919d3caa327b -L dependency=/home/luk/code/target/debug/deps --extern async_trait=/home/luk/code/target/debug/deps/libasync_trait-09449879fe59171c.so --extern axum_core=/home/luk/code/target/debug/deps/libaxum_core-be3802c8acc62418.rmeta --extern bitflags=/home/luk/code/target/debug/deps/libbitflags-17eaae058c49a1b8.rmeta --extern bytes=/home/luk/code/target/debug/deps/libbytes-b51fc775aa196866.rmeta --extern futures_util=/home/luk/code/target/debug/deps/libfutures_util-181be8ad31767cdd.rmeta --extern http=/home/luk/code/target/debug/deps/libhttp-777d680c671caa21.rmeta --extern http_body=/home/luk/code/target/debug/deps/libhttp_body-3675ad811d3791f2.rmeta --extern hyper=/home/luk/code/target/debug/deps/libhyper-26f28c600bdc1ee2.rmeta --extern itoa=/home/luk/code/target/debug/deps/libitoa-94c3240fd22fdaed.rmeta --extern matchit=/home/luk/code/target/debug/deps/libmatchit-82c8078bb1278ab5.rmeta --extern memchr=/home/luk/code/target/debug/deps/libmemchr-3693a015842dadb3.rmeta --extern mime=/home/luk/code/target/debug/deps/libmime-d49ab82920264418.rmeta --extern percent_encoding=/home/luk/code/target/debug/deps/libpercent_encoding-82f182e7e48872ba.rmeta --extern pin_project_lite=/home/luk/code/target/debug/deps/libpin_project_lite-57b44a4b14a3bb39.rmeta --extern serde=/home/luk/code/target/debug/deps/libserde-0d5b7588f54bc67d.rmeta --extern serde_json=/home/luk/code/target/debug/deps/libserde_json-278584084946d9dc.rmeta --extern serde_path_to_error=/home/luk/code/target/debug/deps/libserde_path_to_error-39acfc136a848aca.rmeta --extern serde_urlencoded=/home/luk/code/target/debug/deps/libserde_urlencoded-e540d2bfed2238c6.rmeta --extern sync_wrapper=/home/luk/code/target/debug/deps/libsync_wrapper-1f9c28405a3b7050.rmeta --extern tokio=/home/luk/code/target/debug/deps/libtokio-6e8d9240e9f399fd.rmeta --extern tower=/home/luk/code/target/debug/deps/libtower-3058a136415171e6.rmeta --extern tower_layer=/home/luk/code/target/debug/deps/libtower_layer-e590ca43fcd1237b.rmeta --extern tower_service=/home/luk/code/target/debug/deps/libtower_service-6e838e2bbdb7ccf9.rmeta --crate-version 0.6.20 --cfg nightly_error_messages` (exit status: 101)

rustc-ice-2023-08-22T21:28:21.787458591Z-17768.txt

@lrieb lrieb 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 22, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 22, 2023
@lrieb
Copy link
Author

lrieb commented Aug 22, 2023

I believe this might already be fixed by #115070

@notriddle
Copy link
Contributor

Yep, I tested with the branch. It's fixed.

@notriddle
Copy link
Contributor

Duplicate of #115062

@notriddle notriddle marked this as a duplicate of #115062 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
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 4, 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants