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: no entry found for key #113903

Closed
matthiaskrgr opened this issue Jul 20, 2023 · 2 comments · Fixed by #114147
Closed

ICE: no entry found for key #113903

matthiaskrgr opened this issue Jul 20, 2023 · 2 comments · Fixed by #114147
Assignees
Labels
C-bug Category: This is a bug. F-return_position_impl_trait_in_trait `#![feature(return_position_impl_trait_in_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

#![feature(return_position_impl_trait_in_trait)]

use std::future::Future;

pub trait AsyncTrait {
    fn async_fn_multiple<'a>(&'a self, buff: &[u8]) -> impl Future<Output = Wrapper<impl Sized>>;
}

pub struct Struct;

impl AsyncTrait for Struct {
    fn async_fn_multiple<'a, 'b>(&'a self, buff: &'b [u8]) -> impl Future {}
}

Meta

rustc --version --verbose:

rustc 1.73.0-nightly (39f42ad9e 2023-07-19)
binary: rustc
commit-hash: 39f42ad9e8430a8abb06c262346e89593278c515
commit-date: 2023-07-19
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Error output

error[E0412]: cannot find type `Wrapper` in this scope
 --> treereduce.out:6:77
  |
6 |     fn async_fn_multiple<'a>(&'a self, buff: &[u8]) -> impl Future<Output = Wrapper<impl Sized>>;
  |                                                                             ^^^^^^^ not found in this scope

error[E0601]: `main` function not found in crate `treereduce`
  --> treereduce.out:13:2
   |
13 | }
   |  ^ consider adding a `main` function to `treereduce.out`
Backtrace

thread 'rustc' panicked at 'no entry found for key', compiler/rustc_hir_analysis/src/collect/type_of.rs:321:24
stack backtrace:
   0:     0x7fd450f63221 - std::backtrace_rs::backtrace::libunwind::trace::hb01a67340c9cfb71
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd450f63221 - std::backtrace_rs::backtrace::trace_unsynchronized::h896aca561948c930
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd450f63221 - std::sys_common::backtrace::_print_fmt::h8627be5b68fbde29
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fd450f63221 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b7758da45f4cd22
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd450fc92bc - core::fmt::rt::Argument::fmt::h0eb38586043a01ca
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/core/src/fmt/rt.rs:138:9
   5:     0x7fd450fc92bc - core::fmt::write::h68b52f8aa598961e
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fd450f55c9e - std::io::Write::write_fmt::hc5568929b662da92
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/io/mod.rs:1714:15
   7:     0x7fd450f63035 - std::sys_common::backtrace::_print::h65aecbff12ca83c8
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd450f63035 - std::sys_common::backtrace::print::hf75ac9d60598d247
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd450f65ea3 - std::panicking::default_hook::{{closure}}::hc2cb8da3be7476b0
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/panicking.rs:269:22
  10:     0x7fd450f65bbd - std::panicking::default_hook::hefa49c86da66275b
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/panicking.rs:288:9
  11:     0x7fd45414d26b - rustc_driver_impl[514713931b55c69e]::install_ice_hook::{closure#0}
  12:     0x7fd450f666ce - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf9c5a6df9efa4162
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/alloc/src/boxed.rs:2021:9
  13:     0x7fd450f666ce - std::panicking::rust_panic_with_hook::hd4c3b0056ba96951
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/panicking.rs:709:13
  14:     0x7fd450f66457 - std::panicking::begin_panic_handler::{{closure}}::he487675683e9a525
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/panicking.rs:597:13
  15:     0x7fd450f63686 - std::sys_common::backtrace::__rust_end_short_backtrace::hcff58b9b81620321
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7fd450f661a2 - rust_begin_unwind
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/panicking.rs:593:5
  17:     0x7fd450fc5663 - core::panicking::panic_fmt::h1b81548733a03bd5
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/core/src/panicking.rs:67:14
  18:     0x7fd450fc53c3 - core::panicking::panic_display::h7c844313fb660c81
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/core/src/panicking.rs:150:5
  19:     0x7fd450fc53c3 - core::panicking::panic_str::hf5985d89b9731fa1
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/core/src/panicking.rs:134:5
  20:     0x7fd450fc53c3 - core::option::expect_failed::h56be7b91a8609baf
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/core/src/option.rs:1952:5
  21:     0x7fd45331d7b9 - rustc_hir_analysis[d9a00b9955378be1]::collect::type_of::type_of
  22:     0x7fd452327c23 - rustc_query_impl[93c99b0eaa1db867]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[93c99b0eaa1db867]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 8usize]>>
  23:     0x7fd452327be0 - <rustc_query_impl[93c99b0eaa1db867]::query_impl::type_of::dynamic_query::{closure#2} as core[397656abda24c735]::ops::function::FnOnce<(rustc_middle[edc780a40934b1b4]::ty::context::TyCtxt, rustc_span[5205c608d0f80c8c]::def_id::DefId)>>::call_once
  24:     0x7fd452224845 - rustc_query_system[98421f4e64e29fbf]::query::plumbing::try_execute_query::<rustc_query_impl[93c99b0eaa1db867]::DynamicConfig<rustc_query_system[98421f4e64e29fbf]::query::caches::DefaultCache<rustc_span[5205c608d0f80c8c]::def_id::DefId, rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[93c99b0eaa1db867]::plumbing::QueryCtxt, false>
  25:     0x7fd453ac8f5f - rustc_query_impl[93c99b0eaa1db867]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  26:     0x7fd452ed5aa6 - rustc_middle[edc780a40934b1b4]::query::plumbing::query_get_at::<rustc_query_system[98421f4e64e29fbf]::query::caches::DefaultCache<rustc_span[5205c608d0f80c8c]::def_id::DefId, rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 8usize]>>>
  27:     0x7fd4525c7b40 - <core[397656abda24c735]::iter::adapters::map::Map<core[397656abda24c735]::iter::adapters::flatten::FlatMap<core[397656abda24c735]::slice::iter::Iter<rustc_span[5205c608d0f80c8c]::def_id::DefId>, alloc[2fe2c4c2630469f5]::vec::Vec<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>, rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::enforce_impl_params_are_constrained::{closure#0}>, <hashbrown[81722a7796720d0f]::set::HashSet<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, core[397656abda24c735]::hash::BuildHasherDefault<rustc_hash[e9f3ceaae50ce10c]::FxHasher>> as core[397656abda24c735]::iter::traits::collect::Extend<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>>::extend<core[397656abda24c735]::iter::adapters::flatten::FlatMap<core[397656abda24c735]::slice::iter::Iter<rustc_span[5205c608d0f80c8c]::def_id::DefId>, alloc[2fe2c4c2630469f5]::vec::Vec<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>, rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::enforce_impl_params_are_constrained::{closure#0}>>::{closure#0}> as core[397656abda24c735]::iter::traits::iterator::Iterator>::fold::<(), core[397656abda24c735]::iter::traits::iterator::Iterator::for_each::call<(rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, ()), <hashbrown[81722a7796720d0f]::map::HashMap<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, (), core[397656abda24c735]::hash::BuildHasherDefault<rustc_hash[e9f3ceaae50ce10c]::FxHasher>> as core[397656abda24c735]::iter::traits::collect::Extend<(rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, ())>>::extend<core[397656abda24c735]::iter::adapters::map::Map<core[397656abda24c735]::iter::adapters::flatten::FlatMap<core[397656abda24c735]::slice::iter::Iter<rustc_span[5205c608d0f80c8c]::def_id::DefId>, alloc[2fe2c4c2630469f5]::vec::Vec<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>, rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::enforce_impl_params_are_constrained::{closure#0}>, <hashbrown[81722a7796720d0f]::set::HashSet<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, core[397656abda24c735]::hash::BuildHasherDefault<rustc_hash[e9f3ceaae50ce10c]::FxHasher>> as core[397656abda24c735]::iter::traits::collect::Extend<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>>::extend<core[397656abda24c735]::iter::adapters::flatten::FlatMap<core[397656abda24c735]::slice::iter::Iter<rustc_span[5205c608d0f80c8c]::def_id::DefId>, alloc[2fe2c4c2630469f5]::vec::Vec<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>, rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::enforce_impl_params_are_constrained::{closure#0}>>::{closure#0}>>::{closure#0}>::{closure#0}>
  28:     0x7fd4525c6877 - <hashbrown[81722a7796720d0f]::map::HashMap<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, (), core[397656abda24c735]::hash::BuildHasherDefault<rustc_hash[e9f3ceaae50ce10c]::FxHasher>> as core[397656abda24c735]::iter::traits::collect::Extend<(rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, ())>>::extend::<core[397656abda24c735]::iter::adapters::map::Map<core[397656abda24c735]::iter::adapters::flatten::FlatMap<core[397656abda24c735]::slice::iter::Iter<rustc_span[5205c608d0f80c8c]::def_id::DefId>, alloc[2fe2c4c2630469f5]::vec::Vec<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>, rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::enforce_impl_params_are_constrained::{closure#0}>, <hashbrown[81722a7796720d0f]::set::HashSet<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter, core[397656abda24c735]::hash::BuildHasherDefault<rustc_hash[e9f3ceaae50ce10c]::FxHasher>> as core[397656abda24c735]::iter::traits::collect::Extend<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>>::extend<core[397656abda24c735]::iter::adapters::flatten::FlatMap<core[397656abda24c735]::slice::iter::Iter<rustc_span[5205c608d0f80c8c]::def_id::DefId>, alloc[2fe2c4c2630469f5]::vec::Vec<rustc_hir_analysis[d9a00b9955378be1]::constrained_generic_params::Parameter>, rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::enforce_impl_params_are_constrained::{closure#0}>>::{closure#0}>>
  29:     0x7fd4525c5a79 - rustc_hir_analysis[d9a00b9955378be1]::impl_wf_check::check_mod_impl_wf
  30:     0x7fd452ec113c - rustc_query_impl[93c99b0eaa1db867]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[93c99b0eaa1db867]::query_impl::check_mod_impl_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 0usize]>>
  31:     0x7fd452ec111e - <rustc_query_impl[93c99b0eaa1db867]::query_impl::check_mod_impl_wf::dynamic_query::{closure#2} as core[397656abda24c735]::ops::function::FnOnce<(rustc_middle[edc780a40934b1b4]::ty::context::TyCtxt, rustc_span[5205c608d0f80c8c]::def_id::LocalDefId)>>::call_once
  32:     0x7fd4529b2cff - rustc_query_system[98421f4e64e29fbf]::query::plumbing::try_execute_query::<rustc_query_impl[93c99b0eaa1db867]::DynamicConfig<rustc_query_system[98421f4e64e29fbf]::query::caches::VecCache<rustc_span[5205c608d0f80c8c]::def_id::LocalDefId, rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[93c99b0eaa1db867]::plumbing::QueryCtxt, false>
  33:     0x7fd453ad47b2 - rustc_query_impl[93c99b0eaa1db867]::query_impl::check_mod_impl_wf::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7fd45361d4f7 - <rustc_middle[edc780a40934b1b4]::hir::map::Map>::for_each_module::<rustc_hir_analysis[d9a00b9955378be1]::check_crate::{closure#2}::{closure#0}::{closure#0}>
  35:     0x7fd45361cd42 - <rustc_session[ba429fc99ccfab2c]::session::Session>::track_errors::<rustc_hir_analysis[d9a00b9955378be1]::check_crate::{closure#2}, ()>
  36:     0x7fd45361c44b - rustc_hir_analysis[d9a00b9955378be1]::check_crate
  37:     0x7fd45361bc5a - rustc_interface[948f651da3c72110]::passes::analysis
  38:     0x7fd45362b76a - rustc_query_impl[93c99b0eaa1db867]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[93c99b0eaa1db867]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 1usize]>>
  39:     0x7fd45362b759 - <rustc_query_impl[93c99b0eaa1db867]::query_impl::analysis::dynamic_query::{closure#2} as core[397656abda24c735]::ops::function::FnOnce<(rustc_middle[edc780a40934b1b4]::ty::context::TyCtxt, ())>>::call_once
  40:     0x7fd4537c6938 - rustc_query_system[98421f4e64e29fbf]::query::plumbing::try_execute_query::<rustc_query_impl[93c99b0eaa1db867]::DynamicConfig<rustc_query_system[98421f4e64e29fbf]::query::caches::SingleCache<rustc_middle[edc780a40934b1b4]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[93c99b0eaa1db867]::plumbing::QueryCtxt, false>
  41:     0x7fd4537c66c7 - rustc_query_impl[93c99b0eaa1db867]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  42:     0x7fd45334d5f5 - <rustc_middle[edc780a40934b1b4]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[514713931b55c69e]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>>
  43:     0x7fd45334c674 - <rustc_interface[948f651da3c72110]::interface::Compiler>::enter::<rustc_driver_impl[514713931b55c69e]::run_compiler::{closure#1}::{closure#2}, core[397656abda24c735]::result::Result<core[397656abda24c735]::option::Option<rustc_interface[948f651da3c72110]::queries::Linker>, rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>>
  44:     0x7fd4533498e0 - std[27dde97ad0f94282]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[948f651da3c72110]::util::run_in_thread_pool_with_globals<rustc_interface[948f651da3c72110]::interface::run_compiler<core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>, rustc_driver_impl[514713931b55c69e]::run_compiler::{closure#1}>::{closure#0}, core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>>
  45:     0x7fd4539afa5e - <<std[27dde97ad0f94282]::thread::Builder>::spawn_unchecked_<rustc_interface[948f651da3c72110]::util::run_in_thread_pool_with_globals<rustc_interface[948f651da3c72110]::interface::run_compiler<core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>, rustc_driver_impl[514713931b55c69e]::run_compiler::{closure#1}>::{closure#0}, core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[397656abda24c735]::result::Result<(), rustc_span[5205c608d0f80c8c]::ErrorGuaranteed>>::{closure#1} as core[397656abda24c735]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7fd450f70d85 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf10dda1f0461a8f4
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/alloc/src/boxed.rs:2007:9
  47:     0x7fd450f70d85 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h320a8b9b26e824a4
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/alloc/src/boxed.rs:2007:9
  48:     0x7fd450f70d85 - std::sys::unix::thread::Thread::new::thread_start::h764787faefc7646f
                               at /rustc/39f42ad9e8430a8abb06c262346e89593278c515/library/std/src/sys/unix/thread.rs:108:17
  49:     0x7fd450d0344b - <unknown>
  50:     0x7fd450d86e40 - <unknown>
  51:                0x0 - <unknown>

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

note: rustc 1.73.0-nightly (39f42ad9e 2023-07-19) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [type_of] computing type of `<impl at treereduce.out:11:1: 11:27>::{opaque#1}`
#1 [check_mod_impl_wf] checking that impls are well-formed in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0412, E0601.
For more information about an error, try `rustc --explain E0412`.

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. F-return_position_impl_trait_in_trait `#![feature(return_position_impl_trait_in_trait)]` labels Jul 20, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 20, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-07-11
Regression in 8ca44ef
#112988 cc @spastorino ^^

@compiler-errors
Copy link
Member

This is possibly fixed by #113704, or alternatively #113741. I'll have to look into it, but I'll look into it regardless by tomorrow.

@compiler-errors compiler-errors self-assigned this Jul 20, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 28, 2023
…=spastorino

Insert RPITITs that were shadowed by missing ADTs that resolve to [type error]

Comment inline explains how this can happen.

Fixes rust-lang#113903
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 29, 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. F-return_position_impl_trait_in_trait `#![feature(return_position_impl_trait_in_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants