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: impl Vec<T> where T is also a fn name #105737

Closed
matthiaskrgr opened this issue Dec 15, 2022 · 1 comment · Fixed by #106366
Closed

ICE: rustdoc: impl Vec<T> where T is also a fn name #105737

matthiaskrgr opened this issue Dec 15, 2022 · 1 comment · Fixed by #106366
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

impl Vec<lol> {}

fn lol() {}

Meta

rustc --version --verbose:

rustdoc 1.68.0-nightly (b70baa4f9 2022-12-14)
binary: rustdoc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

<output>
Backtrace

error[E0747]: constant provided when a type was expected
 --> a0fbae68f68b1239dd54b8fc4ada4c0597515cea.rs:1:10
  |
1 | impl Vec<lol> {}
  |          ^^^
  |
  = help: `lol` is a function item, not a type
  = help: function item types cannot be named directly

thread 'rustc' panicked at 'Error', src/librustdoc/clean/mod.rs:1856:25
stack backtrace:
   0:     0x7f8347f657da - std::backtrace_rs::backtrace::libunwind::trace::h58c649c53097142b
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8347f657da - std::backtrace_rs::backtrace::trace_unsynchronized::h8a2218341115550a
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8347f657da - std::sys_common::backtrace::_print_fmt::hea4b2f7f6d570ca4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f8347f657da - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d8d34f4e85c6a60
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8347fc82ee - core::fmt::write::haf2065fc0d3659f4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f8347f55b65 - std::io::Write::write_fmt::h6dce18c304ee54a2
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/io/mod.rs:1682:15
   6:     0x7f8347f655a5 - std::sys_common::backtrace::_print::hec602170f4d3e048
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f8347f655a5 - std::sys_common::backtrace::print::h8aa4a47604c83c88
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f8347f682ef - std::panicking::default_hook::{{closure}}::h68a2f001ac3644c4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:267:22
   9:     0x7f8347f6802b - std::panicking::default_hook::h4861c4cf633cd613
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:286:9
  10:     0x7f8347f68b0c - std::panicking::rust_panic_with_hook::h404216ffd42d1a9f
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:688:13
  11:     0x7f8347f68862 - std::panicking::begin_panic_handler::{{closure}}::hbfc6e95ed3b74164
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:577:13
  12:     0x7f8347f65c8c - std::sys_common::backtrace::__rust_end_short_backtrace::h6c2b4fdde46f911c
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f8347f685b2 - rust_begin_unwind
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:575:5
  14:     0x7f8347fc4cd3 - core::panicking::panic_fmt::h52720972d063b41a
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/core/src/panicking.rs:64:14
  15:     0x56323bb7b5ff - rustdoc[f79df397caf8daff]::clean::clean_middle_ty
  16:     0x56323bb4c17f - rustdoc[f79df397caf8daff]::clean::clean_const
  17:     0x56323bad6063 - <core[a183604df3a39924]::iter::adapters::map::Map<core[a183604df3a39924]::slice::iter::Iter<rustc_hir[23c7b9dd50e700e0]::hir::GenericArg>, rustdoc[f79df397caf8daff]::clean::clean_generic_args::{closure#1}> as core[a183604df3a39924]::iter::traits::iterator::Iterator>::fold::<(), core[a183604df3a39924]::iter::traits::iterator::Iterator::for_each::call<rustdoc[f79df397caf8daff]::clean::types::GenericArg, <alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::GenericArg>>::extend_trusted<core[a183604df3a39924]::iter::adapters::map::Map<core[a183604df3a39924]::slice::iter::Iter<rustc_hir[23c7b9dd50e700e0]::hir::GenericArg>, rustdoc[f79df397caf8daff]::clean::clean_generic_args::{closure#1}>>::{closure#0}>::{closure#0}>
  18:     0x56323b9515fe - <alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::GenericArg> as alloc[51c757b3bc4bb1d4]::vec::spec_from_iter::SpecFromIter<rustdoc[f79df397caf8daff]::clean::types::GenericArg, core[a183604df3a39924]::iter::adapters::map::Map<core[a183604df3a39924]::slice::iter::Iter<rustc_hir[23c7b9dd50e700e0]::hir::GenericArg>, rustdoc[f79df397caf8daff]::clean::clean_generic_args::{closure#1}>>>::from_iter
  19:     0x56323bb582d3 - rustdoc[f79df397caf8daff]::clean::clean_generic_args
  20:     0x56323bb4064d - <thin_vec[95be0f790a1e30cb]::ThinVec<rustdoc[f79df397caf8daff]::clean::types::PathSegment> as core[a183604df3a39924]::iter::traits::collect::FromIterator<rustdoc[f79df397caf8daff]::clean::types::PathSegment>>::from_iter::<core[a183604df3a39924]::iter::adapters::map::Map<core[a183604df3a39924]::slice::iter::Iter<rustc_hir[23c7b9dd50e700e0]::hir::PathSegment>, rustdoc[f79df397caf8daff]::clean::clean_path::{closure#0}>>
  21:     0x56323bb55c3b - rustdoc[f79df397caf8daff]::clean::clean_qpath
  22:     0x56323bb5707c - rustdoc[f79df397caf8daff]::clean::clean_ty
  23:     0x56323bb58e83 - rustdoc[f79df397caf8daff]::clean::clean_impl
  24:     0x56323ba78865 - <rustdoc[f79df397caf8daff]::core::DocContext>::with_param_env::<alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item>, rustdoc[f79df397caf8daff]::clean::clean_maybe_renamed_item::{closure#1}>
  25:     0x56323bb445cc - <&mut rustdoc[f79df397caf8daff]::clean::clean_doc_module::{closure#2} as core[a183604df3a39924]::ops::function::FnOnce<(&(&rustc_hir[23c7b9dd50e700e0]::hir::Item, core[a183604df3a39924]::option::Option<rustc_span[8d98255f5ee7a7e8]::symbol::Symbol>, core[a183604df3a39924]::option::Option<rustc_hir[23c7b9dd50e700e0]::hir_id::HirId>),)>>::call_once
  26:     0x56323b9479d4 - <alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item> as alloc[51c757b3bc4bb1d4]::vec::spec_extend::SpecExtend<rustdoc[f79df397caf8daff]::clean::types::Item, core[a183604df3a39924]::iter::adapters::flatten::FlatMap<core[a183604df3a39924]::slice::iter::Iter<(&rustc_hir[23c7b9dd50e700e0]::hir::Item, core[a183604df3a39924]::option::Option<rustc_span[8d98255f5ee7a7e8]::symbol::Symbol>, core[a183604df3a39924]::option::Option<rustc_hir[23c7b9dd50e700e0]::hir_id::HirId>)>, alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item>, rustdoc[f79df397caf8daff]::clean::clean_doc_module::{closure#2}>>>::spec_extend
  27:     0x56323bb4b3c2 - rustdoc[f79df397caf8daff]::clean::clean_doc_module
  28:     0x56323b858dc1 - rustdoc[f79df397caf8daff]::clean::utils::krate
  29:     0x56323ba0b4d4 - <rustc_session[f809e505f670defe]::session::Session>::time::<rustdoc[f79df397caf8daff]::clean::types::Crate, rustdoc[f79df397caf8daff]::core::run_global_ctxt::{closure#4}>
  30:     0x56323ba7d547 - rustdoc[f79df397caf8daff]::core::run_global_ctxt
  31:     0x56323ba0c954 - <rustc_interface[59cd32f5a8db8a5b]::passes::QueryContext>::enter::<rustdoc[f79df397caf8daff]::main_args::{closure#1}::{closure#0}::{closure#1}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  32:     0x56323b8cd5fa - <rustc_interface[59cd32f5a8db8a5b]::interface::Compiler>::enter::<rustdoc[f79df397caf8daff]::main_args::{closure#1}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  33:     0x56323b9a4b3a - rustc_span[8d98255f5ee7a7e8]::with_source_map::<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  34:     0x56323b833795 - <scoped_tls[d2f689311b6a895]::ScopedKey<rustc_span[8d98255f5ee7a7e8]::SessionGlobals>>::set::<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  35:     0x56323b9b78a0 - std[f8e68897caeb81ab]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[59cd32f5a8db8a5b]::util::run_in_thread_pool_with_globals<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  36:     0x56323bb4102f - <<std[f8e68897caeb81ab]::thread::Builder>::spawn_unchecked_<rustc_interface[59cd32f5a8db8a5b]::util::run_in_thread_pool_with_globals<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>::{closure#1} as core[a183604df3a39924]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7f8347f72903 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hefb6b2db81441f4e
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/alloc/src/boxed.rs:2000:9
  38:     0x7f8347f72903 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h27d69019d3964068
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/alloc/src/boxed.rs:2000:9
  39:     0x7f8347f72903 - std::sys::unix::thread::Thread::new::thread_start::hed02738834385cbc
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7f8347d058fd - <unknown>
  41:     0x7f8347d87a60 - <unknown>
  42:                0x0 - <unknown>
error: aborting due to previous error

For more information about this error, try `rustc --explain E0747`.

@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. labels Dec 15, 2022
@camelid
Copy link
Member

camelid commented Dec 16, 2022

Hmm, rustdoc shouldn't be running if there was a type error in a type signature...

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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants