Closed as not planned
Description
Code
trait Www {
type W;
}
trait Xxx: Www<W = Self::X> {
type X;
}
trait Yyy: Xxx {}
trait Zzz<'a>: Yyy + Xxx<X = Self::Z> {
type Z;
}
trait Aaa {
type Y: Yyy;
}
trait Bbb: Aaa<Y = Self::B> {
type B: for<'a> Zzz<'a>;
}
impl<T> Bbb for T
where
T: Aaa,
T::Y: for<'a> Zzz<'a>,
{
type B = T::Y;
}
pub fn main() {}
Affected release channels
- Previous Stable
- Current Stable
- Current Beta
- Current Nightly
Rust Version
rustc 1.84.0-nightly (bc5cf99 2024-11-05)
binary: rustc
commit-hash: bc5cf99
commit-date: 2024-11-05
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3
Current error output & Backtrace
error: internal compiler error: `[Binder { value: TraitPredicate(<<T as Aaa>::Y as Zzz<'a>>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. })], def_id: DefId(0:6 ~ 48[f03e]::Xxx::X), .. }, Term::Ty(Alias(Projection, AliasTy { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. }), '^0.Named(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), "'a")], def_id: DefId(0:10 ~ 48[f03e]::Zzz::Z), .. }))), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<<T as Aaa>::Y as Xxx>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. })], def_id: DefId(0:4 ~ 48[f03e]::Www::W), .. }, Term::Ty(Alias(Projection, AliasTy { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. }), '?0], def_id: DefId(0:10 ~ 48[f03e]::Zzz::Z), .. }))), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<<T as Aaa>::Y as Www>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<<T as Aaa>::Y as Yyy>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<T as Aaa>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }]` is not fully resolved
|
= note: delayed at /rustc/bc5cf994db9fb46712cefd89f78ad7fc51f184a2/compiler/rustc_infer/src/infer/mod.rs:1175:43
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <rustc_errors::DiagCtxtHandle>::delayed_bug::<alloc::string::String>
4: rustc_trait_selection::traits::do_normalize_predicates
5: rustc_trait_selection::traits::normalize_param_env_or_error
6: rustc_ty_utils::ty::param_env
7: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::param_env::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
9: rustc_query_impl::query_impl::param_env::get_query_non_incr::__rust_end_short_backtrace
10: rustc_hir_analysis::check::wfcheck::check_well_formed
11: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
13: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
14: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
15: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
17: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
18: rustc_hir_analysis::check_crate
19: rustc_interface::passes::run_required_analyses
20: rustc_interface::passes::analysis
21: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
23: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
24: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
25: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
26: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
27: std::sys::pal::unix::thread::Thread::new::thread_start
28: start_thread
at ./nptl/pthread_create.c:442:8
29: __GI___clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
error: internal compiler error: `[Binder { value: TraitPredicate(<<T as Aaa>::Y as Zzz<'a>>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. })], def_id: DefId(0:6 ~ 48[f03e]::Xxx::X), .. }, Term::Ty(Alias(Projection, AliasTy { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. }), '^0.Named(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), "'a")], def_id: DefId(0:10 ~ 48[f03e]::Zzz::Z), .. }))), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<<T as Aaa>::Y as Xxx>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. })], def_id: DefId(0:4 ~ 48[f03e]::Www::W), .. }, Term::Ty(Alias(Projection, AliasTy { args: [Alias(Projection, AliasTy { args: [T/#0], def_id: DefId(0:12 ~ 48[f03e]::Aaa::Y), .. }), '?0], def_id: DefId(0:10 ~ 48[f03e]::Zzz::Z), .. }))), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<<T as Aaa>::Y as Www>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<<T as Aaa>::Y as Yyy>, polarity:Positive), bound_vars: [Region(BrNamed(DefId(0:18 ~ 48[f03e]::{impl#0}::'a), 'a))] }, Binder { value: TraitPredicate(<T as Aaa>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }]` is not fully resolved
|
= note: delayed at /rustc/bc5cf994db9fb46712cefd89f78ad7fc51f184a2/compiler/rustc_infer/src/infer/mod.rs:1175:43
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <rustc_errors::DiagCtxtHandle>::delayed_bug::<alloc::string::String>
4: rustc_trait_selection::traits::do_normalize_predicates
5: rustc_trait_selection::traits::normalize_param_env_or_error
6: rustc_ty_utils::ty::param_env
7: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::param_env::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
9: rustc_query_impl::query_impl::param_env::get_query_non_incr::__rust_end_short_backtrace
10: rustc_hir_analysis::check::check::check_impl_items_against_trait
11: rustc_hir_analysis::check::check::check_item_type
12: rustc_hir_analysis::check::wfcheck::check_well_formed
13: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
15: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
16: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
17: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
19: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
20: rustc_hir_analysis::check_crate
21: rustc_interface::passes::run_required_analyses
22: rustc_interface::passes::analysis
23: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
24: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
25: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
26: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
27: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
28: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
29: std::sys::pal::unix::thread::Thread::new::thread_start
30: start_thread
at ./nptl/pthread_create.c:442:8
31: __GI___clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Metadata
Metadata
Assignees
Labels
Area: Associated items (types, constants & functions)Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)Area: Trait systemCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.Fixed by the next-generation trait solver, `-Znext-solver`.