Skip to content

rustdoc: assertion failed: !name.is_empty() #140026

Closed

Description

@kpreid

Code

Run cargo +nightly doc on:

/// [`String::`]
pub struct Foo;
Original non-minimal repro
cargo add wgpu-types@25.0.0
cargo +nightly rustdoc -p wgpu-types

Meta

rustc --version --verbose:

rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: aarch64-apple-darwin
release: 1.86.0
LLVM version: 19.1.7

Error output

thread 'rustc' panicked at compiler/rustc_middle/src/ty/assoc.rs:253:9:
assertion failed: !name.is_empty()
stack backtrace:
   0:        0x1114c4db0 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::ha26fa7c0f8baf7a4
   1:        0x10eb4b510 - core::fmt::write::h8eff90b819ed25ac
   2:        0x1114b9b90 - std::io::Write::write_fmt::hc3767759e8313866
   3:        0x1114c4c70 - std::sys::backtrace::BacktraceLock::print::h5ab5bdfc8c7040c6
   4:        0x1114c94c0 - std::panicking::default_hook::{{closure}}::h3ff3b576237b0679
   5:        0x1114c918c - std::panicking::default_hook::h2517e562906dc496
   6:        0x10f68d2c8 - std[b96ff11cec95bebb]::panicking::update_hook::<alloc[10845a2db80e37c3]::boxed::Box<rustc_driver_impl[1cdaafc69be13d9e]::install_ice_hook::{closure#1}>>::{closure#0}
   7:        0x1114c9eac - std::panicking::rust_panic_with_hook::hdf5ea4a7520fe9b8
   8:        0x1114c9a78 - std::panicking::begin_panic_handler::{{closure}}::h7e667cf4bf22d5a9
   9:        0x1114c5248 - std::sys::backtrace::__rust_end_short_backtrace::h6ac6505b1a15fed1
  10:        0x1114c9768 - __rustc[e5679b3fd213e125]::rust_begin_unwind
  11:        0x114103028 - core::panicking::panic_fmt::h0d9b963f0cbbd487
  12:        0x114103098 - core::panicking::panic::h9fec57903899a361
  13:        0x1102be8fc - <rustc_middle[b00788c921925d5f]::ty::assoc::AssocItems>::filter_by_name_unhygienic
  14:        0x103064668 - rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::filter_assoc_items_by_name_and_namespace
  15:        0x102f099e0 - <core[77d52d671b80b66]::iter::adapters::map::Map<core[77d52d671b80b66]::iter::adapters::flatten::FlatMap<core[77d52d671b80b66]::slice::iter::Iter<rustc_span[5eba1f9f6065b66a]::def_id::DefId>, core[77d52d671b80b66]::iter::adapters::filter::Filter<core[77d52d671b80b66]::iter::adapters::map::Map<core[77d52d671b80b66]::iter::adapters::map_while::MapWhile<core[77d52d671b80b66]::slice::iter::Iter<u32>, <rustc_data_structures[afa636c047cbec44]::sorted_map::index_map::SortedIndexMultiMap<u32, core[77d52d671b80b66]::option::Option<rustc_span[5eba1f9f6065b66a]::symbol::Symbol>, rustc_middle[b00788c921925d5f]::ty::assoc::AssocItem>>::get_by_key_enumerated::{closure#1}>, <rustc_data_structures[afa636c047cbec44]::sorted_map::index_map::SortedIndexMultiMap<u32, core[77d52d671b80b66]::option::Option<rustc_span[5eba1f9f6065b66a]::symbol::Symbol>, rustc_middle[b00788c921925d5f]::ty::assoc::AssocItem>>::get_by_key::{closure#0}>, rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::filter_assoc_items_by_name_and_namespace::{closure#0}>, <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector>::resolve_associated_item::{closure#2}>, <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector>::resolve_associated_item::{closure#3}> as core[77d52d671b80b66]::iter::traits::iterator::Iterator>::next
  16:        0x1030671c4 - <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector>::resolve_associated_item
  17:        0x103065cc0 - <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector>::resolve
  18:        0x10306abbc - <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector>::resolve_link
  19:        0x1030b4284 - <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector>::resolve_links
  20:        0x103091448 - <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector as rustdoc[535d2b71f692d26c]::visit::DocVisitor>::visit_inner_recur
  21:        0x103091480 - <rustdoc[535d2b71f692d26c]::passes::collect_intra_doc_links::LinkCollector as rustdoc[535d2b71f692d26c]::visit::DocVisitor>::visit_inner_recur
  22:        0x102fb65e8 - rustdoc[535d2b71f692d26c]::core::run_global_ctxt
  23:        0x103099f88 - rustdoc[535d2b71f692d26c]::main_args::{closure#2}::{closure#0}
  24:        0x102e83cb8 - rustc_interface[657d728ad44a5017]::interface::run_compiler::<(), rustdoc[535d2b71f692d26c]::main_args::{closure#2}>::{closure#1}
  25:        0x102e19dfc - std[b96ff11cec95bebb]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[657d728ad44a5017]::util::run_in_thread_with_globals<rustc_interface[657d728ad44a5017]::util::run_in_thread_pool_with_globals<rustc_interface[657d728ad44a5017]::interface::run_compiler<(), rustdoc[535d2b71f692d26c]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  26:        0x102e95e74 - <<std[b96ff11cec95bebb]::thread::Builder>::spawn_unchecked_<rustc_interface[657d728ad44a5017]::util::run_in_thread_with_globals<rustc_interface[657d728ad44a5017]::util::run_in_thread_pool_with_globals<rustc_interface[657d728ad44a5017]::interface::run_compiler<(), rustdoc[535d2b71f692d26c]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[77d52d671b80b66]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:        0x1114cd3b8 - std::sys::pal::unix::thread::Thread::new::thread_start::h9c1a2a521bb44799
  28:        0x19d93dc0c - __pthread_cond_wait

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 make sure that you have updated to the latest nightly

note: please attach the file at `/Users/kpreid/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-types-25.0.0/rustc-ice-2025-04-19T02_38_48-35587.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 `wgpu-types`

@rustbot label +regression-from-stable-to-nightly

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 Apr 19, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Apr 19, 2025
  3. added
    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 Apr 19, 2025
  4. added
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Apr 19, 2025
  5. kpreid commented on Apr 19, 2025

    @kpreid
    ContributorAuthor

    Minimized to:

    /// [`String::`]
    pub struct Foo;

    @rustbot label -E-needs-mcve

  6. removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Apr 19, 2025
  7. added
    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by name
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Apr 19, 2025
  8. apiraino commented on Apr 19, 2025

    @apiraino
    Contributor

    I've bisected that repro just running it with: rustdoc <somefile.rs>. Bisection seems to point at commit f433fa4

    cc @nnethercote and @fee1-dead for #139669

    bisected with cargo-bisect-rustc v0.6.9

    Host triple: x86_64-unknown-linux-gnu
    Reproduce with:

    cargo bisect-rustc --without-cargo --preserve --start 1.85.0 --script test.sh 
  9. apiraino commented on Apr 19, 2025

    @apiraino
    Contributor

    Assigning priority (discussion on Zulip).

    @rustbot label -I-prioritize +P-medium

  10. added and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Apr 19, 2025
  11. fmease commented on Apr 19, 2025

    @fmease
    Member

    cc [@]nnethercote and [@]fmease for [#]139669

    mis-ping, I didn't review that one ;-)

  12. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Apr 19, 2025
  13. GuillaumeGomez commented on Apr 19, 2025

    @GuillaumeGomez
    Member

    Taking a look.

  14. GuillaumeGomez commented on Apr 19, 2025

    @GuillaumeGomez
    Member

    Opened #140052.

  15. added a commit that references this issue on Apr 21, 2025
  16. added a commit that references this issue on Apr 21, 2025
  17. added a commit that references this issue on Apr 21, 2025
  18. added a commit that references this issue on Apr 21, 2025
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

    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) ❄️P-mediumMedium priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions