Skip to content

cargo doc failed on a crate dependent on axum #115146

Closed
@lenianiva

Description

@lenianiva

Code

src/main.rs

fn main()
{
	println!("Hi!");
}

Cargo.toml:

[package]
name = "playground"
version = "0.1.0"
edition = "2021"
rust-version = "1.73"

[dependencies]
axum = "0.6.20"

put the two files above in a rust crate and run cargo doc

Meta

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-apple-darwin
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

error: could not document `axum`
Backtrace

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:        0x103371f0b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6bfe8fe91d200488
   1:        0x1033d277b - core::fmt::write::hc575c23ff7492480
   2:        0x10336698e - std::io::Write::write_fmt::hcbcd7294bdc017f5
   3:        0x103371ce9 - std::sys_common::backtrace::print::h5757a04c770c652a
   4:        0x1033753c8 - std::panicking::panic_hook_with_disk_dump::{{closure}}::hd2c471af8d72f49b
   5:        0x103375090 - std::panicking::panic_hook_with_disk_dump::h0283b8d2350c8289
   6:        0x10d0a10a1 - rustc_driver_impl[fae402f25feeefe6]::install_ice_hook::{closure#0}
   7:        0x103375c10 - std::panicking::rust_panic_with_hook::h9c30aae02f93ee3c
   8:        0x1033759b3 - std::panicking::begin_panic_handler::{{closure}}::hb0055a2f967de7e6
   9:        0x1033723e9 - std::sys_common::backtrace::__rust_end_short_backtrace::h5fa4f457d7750e9c
  10:        0x1033756dd - _rust_begin_unwind
  11:        0x1033fe023 - core::panicking::panic_fmt::h2b32aa03911f185a
  12:        0x1033d7595 - core::str::slice_error_fail_rt::hb659d10da3460421
  13:        0x1033fe7b9 - core::str::slice_error_fail::hce40e2dd1aabb290
  14:        0x1019cfa98 - <rustdoc[f6e30b13c8a58cc4]::passes::collect_intra_doc_links::LinkCollector>::resolve_links
  15:        0x1019beec7 - rustdoc[f6e30b13c8a58cc4]::passes::collect_intra_doc_links::collect_intra_doc_links
  16:        0x10192087a - <rustc_session[606dd55007edbe00]::session::Session>::time::<(rustdoc[f6e30b13c8a58cc4]::clean::types::Crate, rustdoc[f6e30b13c8a58cc4]::config::RenderOptions, rustdoc[f6e30b13c8a58cc4]::formats::cache::Cache), rustdoc[f6e30b13c8a58cc4]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  17:        0x1019f3a8b - <rustc_middle[48eefc34d2f9bd31]::ty::context::GlobalCtxt>::enter::<rustdoc[f6e30b13c8a58cc4]::main_args::{closure#1}::{closure#0}::{closure#0}, core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>>
  18:        0x10192583c - <scoped_tls[2d83633d30ce2f44]::ScopedKey<rustc_span[521d7698a91a3aa1]::SessionGlobals>>::set::<rustc_interface[bd6152b016b86aec]::interface::run_compiler<core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>, rustdoc[f6e30b13c8a58cc4]::main_args::{closure#1}>::{closure#0}, core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>>
  19:        0x101b19b33 - std[353408fa9d0f10c2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[bd6152b016b86aec]::util::run_in_thread_pool_with_globals<rustc_interface[bd6152b016b86aec]::interface::run_compiler<core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>, rustdoc[f6e30b13c8a58cc4]::main_args::{closure#1}>::{closure#0}, core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>>
  20:        0x101b1a2ae - <<std[353408fa9d0f10c2]::thread::Builder>::spawn_unchecked_<rustc_interface[bd6152b016b86aec]::util::run_in_thread_pool_with_globals<rustc_interface[bd6152b016b86aec]::interface::run_compiler<core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>, rustdoc[f6e30b13c8a58cc4]::main_args::{closure#1}>::{closure#0}, core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bcb82f3d42648ebb]::result::Result<(), rustc_span[521d7698a91a3aa1]::ErrorGuaranteed>>::{closure#1} as core[bcb82f3d42648ebb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:        0x10337f949 - std::sys::unix::thread::Thread::new::thread_start::h7492239c3b59ea89
  22:     0x7ff8135ed1d3 - __pthread_start


rustc version: 1.74.0-nightly (ef85656a1 2023-08-21)
platform: x86_64-apple-darwin

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-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