Closed
Description
Code
struct HasLifetime<'a>(core::marker::PhantomData<&'a u32>);
struct Wrap<T: for<'a> FnMut(HasLifetime<'a>)>(T);
fn doesnt_satisfy_requirements<'a>(args: HasLifetime<'a>) {}
// isn't send or sync, also an &dyn FnMut doesn't satisfy FnMut.
static STATIC_OR_CONST_VAR: Wrap<&'static dyn for<'a> FnMut(HasLifetime<'a>)> = Wrap(&doesnt_satisfy_requirements);
Meta
rustc +nightly --version --verbose
:
rustc 1.56.0-nightly (ad981d58e 2021-08-08)
binary: rustc
commit-hash: ad981d58e1ca16bcf4072577934630deb11c5e14
commit-date: 2021-08-08
host: x86_64-unknown-linux-gnu
release: 1.56.0-nightly
LLVM version: 12.0.1
compiler flags:
-C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
Error output
error: internal compiler error: compiler/rustc_middle/src/ich/impls_ty.rs:94:17: StableHasher: unexpected region RePlaceholder(Placeholder { universe: U1, name: BrNamed(DefId(0:10 ~ ice[14c8]::Wrap::'a), 'a) })
Backtrace
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1046:9
stack backtrace:
0: std::panicking::begin_panic
1: std::panic::panic_any
2: rustc_errors::HandlerInner::bug
3: rustc_errors::Handler::bug
4: rustc_middle::ty::context::tls::with_opt
5: rustc_middle::util::bug::opt_span_bug_fmt
6: rustc_middle::util::bug::bug_fmt
7: rustc_middle::ich::impls_ty::<impl rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext> for rustc_middle::ty::sty::RegionKind>::hash_stable
8: std::thread::local::LocalKey<T>::with
9: <rustc_middle::ty::TyS as rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext>>::hash_stable
10: std::thread::local::LocalKey<T>::with
11: <rustc_middle::ty::TyS as rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext>>::hash_stable
12: std::thread::local::LocalKey<T>::with
13: rustc_middle::ich::impls_ty::<impl rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext> for rustc_middle::ty::sty::Binder<T>>::hash_stable
14: <T as rustc_query_system::dep_graph::dep_node::DepNodeParams<Ctxt>>::to_fingerprint
15: rustc_query_system::query::config::QueryVtable<CTX,K,V>::to_dep_node
16: rustc_query_system::query::plumbing::get_query_impl
17: rustc_query_system::query::plumbing::get_query
18: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtExt>::report_selection_error
19: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
20: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtExt>::report_fulfillment_errors
21: rustc_typeck::check::fn_ctxt::_impl::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::select_all_obligations_or_error
22: rustc_infer::infer::InferCtxtBuilder::enter
23: rustc_typeck::check::wfcheck::check_item_well_formed
24: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
25: rustc_data_structures::stack::ensure_sufficient_stack
26: rustc_query_system::query::plumbing::force_query_with_job
27: rustc_query_system::query::plumbing::get_query_impl
28: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_item_well_formed
29: <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor as rustc_hir::intravisit::Visitor>::visit_item
30: std::panicking::try
31: rustc_data_structures::sync::par_for_each_in
32: rustc_session::session::Session::track_errors
33: rustc_typeck::check_crate
34: rustc_interface::passes::analysis
35: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
36: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
37: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
38: rustc_data_structures::stack::ensure_sufficient_stack
39: rustc_query_system::query::plumbing::force_query_with_job
40: rustc_query_system::query::plumbing::get_query_impl
41: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
42: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
43: rustc_span::with_source_map
44: rustc_interface::interface::create_compiler_and_run
45: scoped_tls::ScopedKey<T>::set