From 591da2b985d7c2e1388c5e1ad595f225c90ab90e Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 17 Jan 2025 15:48:45 +0100 Subject: [PATCH] Fix order of `Call` trait clauses --- frontend/exporter/src/types/mir.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/exporter/src/types/mir.rs b/frontend/exporter/src/types/mir.rs index ffc2535c2..24bf3d8c0 100644 --- a/frontend/exporter/src/types/mir.rs +++ b/frontend/exporter/src/types/mir.rs @@ -398,9 +398,11 @@ pub(crate) fn get_function_from_def_id_and_generics<'tcx, S: BaseState<'tcx> + H // Solve the trait constraints of the impl block. let container_generics = tcx.generics_of(container_def_id); let container_generics = generics.truncate_to(tcx, container_generics); - let container_trait_refs = + // Prepend the container trait refs. + let mut combined_trait_refs = solve_item_required_traits(s, container_def_id, container_generics); - trait_refs.extend(container_trait_refs); + combined_trait_refs.extend(std::mem::take(&mut trait_refs)); + trait_refs = combined_trait_refs; (generics.sinto(s), None) } }