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: rustdoc: Could not find associated const on trait #106079

Closed
matthiaskrgr opened this issue Dec 23, 2022 · 6 comments
Closed

ICE: rustdoc: Could not find associated const on trait #106079

matthiaskrgr opened this issue Dec 23, 2022 · 6 comments
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

./src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs

trait X {
    type Y<'a>;
}

const _: () = {
  fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
      //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
      //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
};

fn main() {}

Meta

rustc --version --verbose:

rustc 1.68.0-nightly (8a97b4812 2022-12-22)
binary: rustc
commit-hash: 8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9
commit-date: 2022-12-22
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

<output>
Backtrace

thread 'rustc' panicked at 'Error', src/librustdoc/clean/mod.rs:1856:25
stack backtrace:
   0:     0x7f3c8ab65a7a - std::backtrace_rs::backtrace::libunwind::trace::h250f5acc74207c14
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3c8ab65a7a - std::backtrace_rs::backtrace::trace_unsynchronized::h8b2cc87ea209f556
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3c8ab65a7a - std::sys_common::backtrace::_print_fmt::he79fe9ac625765a8
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f3c8ab65a7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b8cfd7233c5cf16
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f3c8abc87ae - core::fmt::write::hf4356953bb6287e9
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f3c8ab55e45 - std::io::Write::write_fmt::h777ff3ca89a9d1e9
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/io/mod.rs:1682:15
   6:     0x7f3c8ab65845 - std::sys_common::backtrace::_print::h30bd0c5979c85003
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f3c8ab65845 - std::sys_common::backtrace::print::he11670adbc4564f8
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f3c8ab6858f - std::panicking::default_hook::{{closure}}::h2b850e11ab02b140
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:267:22
   9:     0x7f3c8ab682cb - std::panicking::default_hook::h5e8af7c8d5de5af1
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:286:9
  10:     0x7f3c8de4d151 - rustc_driver[b1659719c04a24c8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f3c8ab68dcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3e73a49254418f01
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/alloc/src/boxed.rs:2032:9
  12:     0x7f3c8ab68dcd - std::panicking::rust_panic_with_hook::hfdcd0659796f0493
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:692:13
  13:     0x7f3c8ab68b02 - std::panicking::begin_panic_handler::{{closure}}::h1da0d3ec43a330b4
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:577:13
  14:     0x7f3c8ab65f2c - std::sys_common::backtrace::__rust_end_short_backtrace::hda54127fbb19e796
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f3c8ab68852 - rust_begin_unwind
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:575:5
  16:     0x7f3c8abc5193 - core::panicking::panic_fmt::h757cae3820c90eb4
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/core/src/panicking.rs:64:14
  17:     0x564000a003ef - rustdoc[b533b40e318b555]::clean::clean_middle_ty
  18:     0x5640009cf74f - rustdoc[b533b40e318b555]::clean::clean_const
  19:     0x564000953b13 - <core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::GenericArg>, rustdoc[b533b40e318b555]::clean::clean_generic_args::{closure#1}> as core[838cd329d32ba501]::iter::traits::iterator::Iterator>::fold::<(), core[838cd329d32ba501]::iter::traits::iterator::Iterator::for_each::call<rustdoc[b533b40e318b555]::clean::types::GenericArg, <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::GenericArg>>::extend_trusted<core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::GenericArg>, rustdoc[b533b40e318b555]::clean::clean_generic_args::{closure#1}>>::{closure#0}>::{closure#0}>
  20:     0x564000795d5e - <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::GenericArg> as alloc[225e6e9bb7b947dc]::vec::spec_from_iter::SpecFromIter<rustdoc[b533b40e318b555]::clean::types::GenericArg, core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::GenericArg>, rustdoc[b533b40e318b555]::clean::clean_generic_args::{closure#1}>>>::from_iter
  21:     0x5640009db7a3 - rustdoc[b533b40e318b555]::clean::clean_generic_args
  22:     0x5640009db849 - rustdoc[b533b40e318b555]::clean::clean_generic_args
  23:     0x5640009c5c7d - <thin_vec[c3567fdbde1f8e7]::ThinVec<rustdoc[b533b40e318b555]::clean::types::PathSegment> as core[838cd329d32ba501]::iter::traits::collect::FromIterator<rustdoc[b533b40e318b555]::clean::types::PathSegment>>::from_iter::<core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::PathSegment>, rustdoc[b533b40e318b555]::clean::clean_path::{closure#0}>>
  24:     0x5640009d61e0 - rustdoc[b533b40e318b555]::clean::clean_poly_trait_ref
  25:     0x56400079befe - <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::PolyTrait> as alloc[225e6e9bb7b947dc]::vec::spec_from_iter::SpecFromIter<rustdoc[b533b40e318b555]::clean::types::PolyTrait, core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::PolyTraitRef>, rustdoc[b533b40e318b555]::clean::clean_ty::{closure#2}>>>::from_iter
  26:     0x5640009da42e - rustdoc[b533b40e318b555]::clean::clean_ty
  27:     0x564000953aca - <core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::GenericArg>, rustdoc[b533b40e318b555]::clean::clean_generic_args::{closure#1}> as core[838cd329d32ba501]::iter::traits::iterator::Iterator>::fold::<(), core[838cd329d32ba501]::iter::traits::iterator::Iterator::for_each::call<rustdoc[b533b40e318b555]::clean::types::GenericArg, <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::GenericArg>>::extend_trusted<core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::GenericArg>, rustdoc[b533b40e318b555]::clean::clean_generic_args::{closure#1}>>::{closure#0}>::{closure#0}>
  28:     0x564000795d5e - <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::GenericArg> as alloc[225e6e9bb7b947dc]::vec::spec_from_iter::SpecFromIter<rustdoc[b533b40e318b555]::clean::types::GenericArg, core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::GenericArg>, rustdoc[b533b40e318b555]::clean::clean_generic_args::{closure#1}>>>::from_iter
  29:     0x5640009db7a3 - rustdoc[b533b40e318b555]::clean::clean_generic_args
  30:     0x5640009c5c7d - <thin_vec[c3567fdbde1f8e7]::ThinVec<rustdoc[b533b40e318b555]::clean::types::PathSegment> as core[838cd329d32ba501]::iter::traits::collect::FromIterator<rustdoc[b533b40e318b555]::clean::types::PathSegment>>::from_iter::<core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::PathSegment>, rustdoc[b533b40e318b555]::clean::clean_path::{closure#0}>>
  31:     0x5640009d910b - rustdoc[b533b40e318b555]::clean::clean_qpath
  32:     0x5640009da54c - rustdoc[b533b40e318b555]::clean::clean_ty
  33:     0x56400079b179 - <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::Argument> as alloc[225e6e9bb7b947dc]::vec::spec_from_iter::SpecFromIter<rustdoc[b533b40e318b555]::clean::types::Argument, core[838cd329d32ba501]::iter::adapters::map::Map<core[838cd329d32ba501]::iter::adapters::enumerate::Enumerate<core[838cd329d32ba501]::slice::iter::Iter<rustc_hir[cdef261b456c4bde]::hir::Ty>>, rustdoc[b533b40e318b555]::clean::clean_args_from_types_and_body_id::{closure#0}>>>::from_iter
  34:     0x5640006d6a29 - rustdoc[b533b40e318b555]::clean::utils::enter_impl_trait::<rustdoc[b533b40e318b555]::clean::clean_function::{closure#0}, (rustdoc[b533b40e318b555]::clean::types::Generics, rustdoc[b533b40e318b555]::clean::types::FnDecl)>
  35:     0x5640009d513b - rustdoc[b533b40e318b555]::clean::clean_fn_or_proc_macro
  36:     0x56400091d603 - <rustdoc[b533b40e318b555]::core::DocContext>::with_param_env::<alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::Item>, rustdoc[b533b40e318b555]::clean::clean_maybe_renamed_item::{closure#1}>
  37:     0x5640009c835c - <&mut rustdoc[b533b40e318b555]::clean::clean_doc_module::{closure#2} as core[838cd329d32ba501]::ops::function::FnOnce<(&(&rustc_hir[cdef261b456c4bde]::hir::Item, core[838cd329d32ba501]::option::Option<rustc_span[506ca92461b63806]::symbol::Symbol>, core[838cd329d32ba501]::option::Option<rustc_hir[cdef261b456c4bde]::hir_id::HirId>),)>>::call_once
  38:     0x56400078c114 - <alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::Item> as alloc[225e6e9bb7b947dc]::vec::spec_extend::SpecExtend<rustdoc[b533b40e318b555]::clean::types::Item, core[838cd329d32ba501]::iter::adapters::flatten::FlatMap<core[838cd329d32ba501]::slice::iter::Iter<(&rustc_hir[cdef261b456c4bde]::hir::Item, core[838cd329d32ba501]::option::Option<rustc_span[506ca92461b63806]::symbol::Symbol>, core[838cd329d32ba501]::option::Option<rustc_hir[cdef261b456c4bde]::hir_id::HirId>)>, alloc[225e6e9bb7b947dc]::vec::Vec<rustdoc[b533b40e318b555]::clean::types::Item>, rustdoc[b533b40e318b555]::clean::clean_doc_module::{closure#2}>>>::spec_extend
  39:     0x5640009ce988 - rustdoc[b533b40e318b555]::clean::clean_doc_module
  40:     0x5640006d2b61 - rustdoc[b533b40e318b555]::clean::utils::krate
  41:     0x5640008934f4 - <rustc_session[9a79971eab3e0f2f]::session::Session>::time::<rustdoc[b533b40e318b555]::clean::types::Crate, rustdoc[b533b40e318b555]::core::run_global_ctxt::{closure#4}>
  42:     0x5640009222b7 - rustdoc[b533b40e318b555]::core::run_global_ctxt
  43:     0x564000894844 - <rustc_interface[27db4dcdd626da73]::passes::QueryContext>::enter::<rustdoc[b533b40e318b555]::main_args::{closure#1}::{closure#0}::{closure#1}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>
  44:     0x5640006e612a - <rustc_interface[27db4dcdd626da73]::interface::Compiler>::enter::<rustdoc[b533b40e318b555]::main_args::{closure#1}::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>
  45:     0x56400082c20a - rustc_span[506ca92461b63806]::with_source_map::<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  46:     0x5640006b10b5 - <scoped_tls[57eb591005101a44]::ScopedKey<rustc_span[506ca92461b63806]::SessionGlobals>>::set::<rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>
  47:     0x56400083e900 - std[1a5a851d154403c1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[27db4dcdd626da73]::util::run_in_thread_pool_with_globals<rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>
  48:     0x56400099c02f - <<std[1a5a851d154403c1]::thread::Builder>::spawn_unchecked_<rustc_interface[27db4dcdd626da73]::util::run_in_thread_pool_with_globals<rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>::{closure#1} as core[838cd329d32ba501]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x7f3c8ab72dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8220a33137e05636
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/alloc/src/boxed.rs:2000:9
  50:     0x7f3c8ab72dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcde99a22c299cd7f
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/alloc/src/boxed.rs:2000:9
  51:     0x7f3c8ab72dc3 - std::sys::unix::thread::Thread::new::thread_start::h608d02a3e5faa1ee
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7f3c8a8d98fd - <unknown>
  53:     0x7f3c8a95ba60 - <unknown>
  54:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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-compiler&template=ice.md

note: rustc 1.68.0-nightly (8a97b4812 2022-12-22) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: Could not find associated const on trait
  |
  = note: delayed at compiler/rustc_hir_analysis/src/collect/type_of.rs:509:29

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
stack backtrace:
   0:     0x7f3c8ab65a7a - std::backtrace_rs::backtrace::libunwind::trace::h250f5acc74207c14
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3c8ab65a7a - std::backtrace_rs::backtrace::trace_unsynchronized::h8b2cc87ea209f556
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3c8ab65a7a - std::sys_common::backtrace::_print_fmt::he79fe9ac625765a8
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f3c8ab65a7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b8cfd7233c5cf16
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f3c8abc87ae - core::fmt::write::hf4356953bb6287e9
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f3c8ab55e45 - std::io::Write::write_fmt::h777ff3ca89a9d1e9
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/io/mod.rs:1682:15
   6:     0x7f3c8ab65845 - std::sys_common::backtrace::_print::h30bd0c5979c85003
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f3c8ab65845 - std::sys_common::backtrace::print::he11670adbc4564f8
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f3c8ab6858f - std::panicking::default_hook::{{closure}}::h2b850e11ab02b140
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:267:22
   9:     0x7f3c8ab682cb - std::panicking::default_hook::h5e8af7c8d5de5af1
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:286:9
  10:     0x7f3c8de4d151 - rustc_driver[b1659719c04a24c8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f3c8ab68dcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3e73a49254418f01
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/alloc/src/boxed.rs:2032:9
  12:     0x7f3c8ab68dcd - std::panicking::rust_panic_with_hook::hfdcd0659796f0493
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/panicking.rs:692:13
  13:     0x7f3c8de860a1 - std[1a5a851d154403c1]::panicking::begin_panic::<rustc_errors[f3b4af3fda1898a3]::ExplicitBug>::{closure#0}
  14:     0x7f3c8de84976 - std[1a5a851d154403c1]::sys_common::backtrace::__rust_end_short_backtrace::<std[1a5a851d154403c1]::panicking::begin_panic<rustc_errors[f3b4af3fda1898a3]::ExplicitBug>::{closure#0}, !>
  15:     0x7f3c8de626e6 - std[1a5a851d154403c1]::panicking::begin_panic::<rustc_errors[f3b4af3fda1898a3]::ExplicitBug>
  16:     0x7f3c8de81e46 - std[1a5a851d154403c1]::panic::panic_any::<rustc_errors[f3b4af3fda1898a3]::ExplicitBug>
  17:     0x7f3c8d368f96 - <rustc_errors[f3b4af3fda1898a3]::HandlerInner>::flush_delayed::<alloc[225e6e9bb7b947dc]::vec::Vec<rustc_errors[f3b4af3fda1898a3]::diagnostic::Diagnostic>, &str>
  18:     0x7f3c8d36829b - <rustc_errors[f3b4af3fda1898a3]::HandlerInner as core[838cd329d32ba501]::ops::drop::Drop>::drop
  19:     0x564000a1333e - core[838cd329d32ba501]::ptr::drop_in_place::<rustc_session[9a79971eab3e0f2f]::parse::ParseSess>
  20:     0x564000a14c9f - core[838cd329d32ba501]::ptr::drop_in_place::<rustc_session[9a79971eab3e0f2f]::session::Session>
  21:     0x564000834b2d - core[838cd329d32ba501]::ptr::drop_in_place::<rustc_interface[27db4dcdd626da73]::interface::Compiler>
  22:     0x56400082c3c4 - rustc_span[506ca92461b63806]::with_source_map::<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  23:     0x5640006b10b5 - <scoped_tls[57eb591005101a44]::ScopedKey<rustc_span[506ca92461b63806]::SessionGlobals>>::set::<rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>
  24:     0x56400083e900 - std[1a5a851d154403c1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[27db4dcdd626da73]::util::run_in_thread_pool_with_globals<rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>
  25:     0x56400099c02f - <<std[1a5a851d154403c1]::thread::Builder>::spawn_unchecked_<rustc_interface[27db4dcdd626da73]::util::run_in_thread_pool_with_globals<rustc_interface[27db4dcdd626da73]::interface::run_compiler<core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>, rustdoc[b533b40e318b555]::main_args::{closure#1}>::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[838cd329d32ba501]::result::Result<(), rustc_errors[f3b4af3fda1898a3]::ErrorGuaranteed>>::{closure#1} as core[838cd329d32ba501]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:     0x7f3c8ab72dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8220a33137e05636
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/alloc/src/boxed.rs:2000:9
  27:     0x7f3c8ab72dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcde99a22c299cd7f
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/alloc/src/boxed.rs:2000:9
  28:     0x7f3c8ab72dc3 - std::sys::unix::thread::Thread::new::thread_start::h608d02a3e5faa1ee
                               at /rustc/8a97b4812a7a46bb5206487c2455b9c5bfcbd1b9/library/std/src/sys/unix/thread.rs:108:17
  29:     0x7f3c8a8d98fd - <unknown>
  30:     0x7f3c8a95ba60 - <unknown>
  31:                0x0 - <unknown>

note: 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-compiler&template=ice.md

note: rustc 1.68.0-nightly (8a97b4812 2022-12-22) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
[1]    3474971 IOT instruction (core dumped)  rustdoc

@matthiaskrgr matthiaskrgr added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Dec 23, 2022
@matthiaskrgr
Copy link
Member Author

Regression in cce9e72

@JohnTitor
Copy link
Member

Triage: This is no longer ICE since nightly-2023-01-21, marking as E-needs-test.

@JohnTitor JohnTitor added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jan 21, 2023
@megakorre
Copy link
Contributor

megakorre commented Feb 27, 2023

Tried to add a test. But it seems it had time to regress again. #107000
Edit: there was a revert that "fixed" it #107083 and the another attempt at it after it seems.

searched nightlies: from nightly-2023-01-29 to nightly-2023-02-20
regressed nightly: nightly-2023-02-04
searched commit range: https://github.com/rust-lang/rust/compare/f3126500f25114ba4e0ac3e76694dd45a22de56d...658fad6c5506f41c35b64fb1a22ceb0992697ff3
regressed commit: https://github.com/rust-lang/rust/commit/6c991b07403a3234dd1ec0ac973b8ef97055e605

This ICE happens without the const block. Maybe the regression is just about that it is now walking const blocks but the actual ICE is something else.

@megakorre
Copy link
Contributor

The code without the const block.

trait X {
    type Y<'a>;
}
fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}

Has been causing ICE in rustdoc rendering (clean) since GATs rustdoc rendering was introduced in #94009

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 30, 2023
…eck_before_clean, r=GuillaumeGomez

rustdoc: run more HIR validation to mirror rustc

# Explanation

While investigating these issues: rust-lang#107093, rust-lang#106079
I thought it maybe would be useful to test running `rustdoc` on all rust files under `tests/ui` grepping for files that causes any ICEs.
And these are the files I found would cause ICEs.
```
// These are handled by this fix.
tests/ui/late-bound-lifetimes/mismatched_arg_count.rs
tests/ui/associated-consts/issue-102335-const.rs
tests/ui/const-generics/generic_const_exprs/issue-102768.rs
tests/ui/const-generics/const-arg-type-arg-misordered.rs
tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
tests/ui/typeck/issue-88643.rs
tests/ui/typeck/issue-75889.rs
tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs
// These are not they will still produce a ICE after this change
tests/ui/limits/issue-56762.rs
tests/ui/union/projection-as-union-type-error-2.rs
tests/ui/union/projection-as-union-type-error.rs
```

I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues.
But the 3 files that are not handled I will leave for a future PR.

This PR adds the `type_collecting` step from `hir_analysis::check_crate` to the rustdoc typechecks.
It had the following comment on it.
```
// this ensures that later parts of type checking can assume that items
// have valid types and not error
```
Adding the check report the same errors as rustc does for these input.
And not ICE when the lint checker walks the HIR or when in the `rustdoc::clean` pass.

This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors).
These new reported errors does mirror the errors reported by rustc.

# Performance
It does more checking so it will probably regress. We should run ``@bors` try `@rust-timer` queue` and see.

# Discussion

Maybe instead of calling a subset of the checks in `hir_analysis::check_crate` and having comments that say they should be kept in sync. We could instead call `check_crate` directly and pass in some flag. Maybe `check_toplevel_signatures_only` or something like that. That flag would have to skip most of the checks in that function tough.
@fmease
Copy link
Member

fmease commented Apr 30, 2023

This issue was fixed by #108576 which contains a regression test for it (tests/rustdoc-ui/invalid_const_in_lifetime_position.rs).
The reproducer now correctly reports errors instead of ice'ing or exiting successfully. Before the PR was merged, glacier-bot noticed that the reproducer went from ICE to no errors (rust-lang/glacier#1496). This, however, is no longer up to date or relevant.

This issue should be closed.

@rustbot label -E-needs-test

@rustbot rustbot removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 30, 2023
@fmease
Copy link
Member

fmease commented Sep 6, 2023

Closing as fixed by #108576

@fmease fmease closed this as completed Sep 6, 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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants