@@ -5,7 +5,7 @@ mod opaque_types;
55
66use rustc_type_ir:: fast_reject:: DeepRejectCtxt ;
77use rustc_type_ir:: inherent:: * ;
8- use rustc_type_ir:: lang_items:: { SolverLangItem , SolverTraitLangItem } ;
8+ use rustc_type_ir:: lang_items:: { SolverAdtLangItem , SolverLangItem , SolverTraitLangItem } ;
99use rustc_type_ir:: solve:: SizedTraitKind ;
1010use rustc_type_ir:: { self as ty, Interner , NormalizesTo , PredicateKind , Upcast as _} ;
1111use tracing:: instrument;
@@ -193,7 +193,7 @@ where
193193 fn consider_impl_candidate (
194194 ecx : & mut EvalCtxt < ' _ , D > ,
195195 goal : Goal < I , NormalizesTo < I > > ,
196- impl_def_id : I :: DefId ,
196+ impl_def_id : I :: ImplId ,
197197 ) -> Result < Candidate < I > , NoSolution > {
198198 let cx = ecx. cx ( ) ;
199199
@@ -217,13 +217,13 @@ where
217217 } ;
218218
219219 ecx. probe_trait_candidate ( CandidateSource :: Impl ( impl_def_id) ) . enter ( |ecx| {
220- let impl_args = ecx. fresh_args_for_item ( impl_def_id) ;
220+ let impl_args = ecx. fresh_args_for_item ( impl_def_id. into ( ) ) ;
221221 let impl_trait_ref = impl_trait_ref. instantiate ( cx, impl_args) ;
222222
223223 ecx. eq ( goal. param_env , goal_trait_ref, impl_trait_ref) ?;
224224
225225 let where_clause_bounds = cx
226- . predicates_of ( impl_def_id)
226+ . predicates_of ( impl_def_id. into ( ) )
227227 . iter_instantiated ( cx, impl_args)
228228 . map ( |pred| goal. with ( cx, pred) ) ;
229229 ecx. add_goals ( GoalSource :: ImplWhereBound , where_clause_bounds) ;
@@ -824,10 +824,10 @@ where
824824 // coroutine yield ty `Poll<Option<I>>`.
825825 let wrapped_expected_ty = Ty :: new_adt (
826826 cx,
827- cx. adt_def ( cx. require_lang_item ( SolverLangItem :: Poll ) ) ,
827+ cx. adt_def ( cx. require_adt_lang_item ( SolverAdtLangItem :: Poll ) ) ,
828828 cx. mk_args ( & [ Ty :: new_adt (
829829 cx,
830- cx. adt_def ( cx. require_lang_item ( SolverLangItem :: Option ) ) ,
830+ cx. adt_def ( cx. require_adt_lang_item ( SolverAdtLangItem :: Option ) ) ,
831831 cx. mk_args ( & [ expected_ty. into ( ) ] ) ,
832832 )
833833 . into ( ) ] ) ,
@@ -979,7 +979,7 @@ where
979979 fn translate_args (
980980 & mut self ,
981981 goal : Goal < I , ty:: NormalizesTo < I > > ,
982- impl_def_id : I :: DefId ,
982+ impl_def_id : I :: ImplId ,
983983 impl_args : I :: GenericArgs ,
984984 impl_trait_ref : rustc_type_ir:: TraitRef < I > ,
985985 target_container_def_id : I :: DefId ,
@@ -988,14 +988,15 @@ where
988988 Ok ( if target_container_def_id == impl_trait_ref. def_id . into ( ) {
989989 // Default value from the trait definition. No need to rebase.
990990 goal. predicate . alias . args
991- } else if target_container_def_id == impl_def_id {
991+ } else if target_container_def_id == impl_def_id. into ( ) {
992992 // Same impl, no need to fully translate, just a rebase from
993993 // the trait is sufficient.
994994 goal. predicate . alias . args . rebase_onto ( cx, impl_trait_ref. def_id . into ( ) , impl_args)
995995 } else {
996996 let target_args = self . fresh_args_for_item ( target_container_def_id) ;
997- let target_trait_ref =
998- cx. impl_trait_ref ( target_container_def_id) . instantiate ( cx, target_args) ;
997+ let target_trait_ref = cx
998+ . impl_trait_ref ( target_container_def_id. try_into ( ) . unwrap ( ) )
999+ . instantiate ( cx, target_args) ;
9991000 // Relate source impl to target impl by equating trait refs.
10001001 self . eq ( goal. param_env , impl_trait_ref, target_trait_ref) ?;
10011002 // Also add predicates since they may be needed to constrain the
0 commit comments