@@ -13,7 +13,7 @@ use rustc_infer::infer::TyCtxtInferExt;
1313use rustc_middle:: mir:: interpret:: { CTFE_ALLOC_SALT , read_target_uint, write_target_uint} ;
1414use rustc_middle:: mir:: { self , BinOp , ConstValue , NonDivergingIntrinsic } ;
1515use rustc_middle:: ty:: layout:: TyAndLayout ;
16- use rustc_middle:: ty:: { FloatTy , Ty , TyCtxt , TypeFoldable , Upcast } ;
16+ use rustc_middle:: ty:: { FloatTy , Ty , TyCtxt , TypeFoldable , PolyExistentialPredicate } ;
1717use rustc_middle:: { bug, span_bug, ty} ;
1818use rustc_span:: { Symbol , sym} ;
1919use rustc_trait_selection:: traits:: { Obligation , ObligationCause , ObligationCtxt } ;
@@ -22,7 +22,7 @@ use tracing::trace;
2222use super :: memory:: MemoryKind ;
2323use super :: util:: ensure_monomorphic_enough;
2424use super :: {
25- AllocId , Allocation , CheckInAllocMsg , ConstAllocation , ImmTy , InterpCx , InterpResult , Machine ,
25+ AllocId , CheckInAllocMsg , ImmTy , InterpCx , InterpResult , Machine ,
2626 OpTy , PlaceTy , Pointer , PointerArithmetic , Provenance , Scalar , err_ub_custom, err_unsup_format,
2727 interp_ok, throw_inval, throw_ub_custom, throw_ub_format,
2828} ;
@@ -228,7 +228,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
228228
229229 ensure_monomorphic_enough ( tcx, tp_ty) ?;
230230 ensure_monomorphic_enough ( tcx, result_ty) ?;
231- let ty:: Dynamic ( preds, _, ty :: Dyn ) = result_ty. kind ( ) else {
231+ let ty:: Dynamic ( preds, _) = result_ty. kind ( ) else {
232232 span_bug ! (
233233 self . find_closest_untracked_caller_location( ) ,
234234 "Invalid type provided to vtable_for::<T, U>. U must be dyn Trait, got {result_ty}."
@@ -239,7 +239,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
239239 self . tcx . infer_ctxt ( ) . build_with_typing_env ( self . typing_env ) ;
240240
241241 let ocx = ObligationCtxt :: new ( & infcx) ;
242- ocx. register_obligations ( preds. iter ( ) . map ( |pred| {
242+ ocx. register_obligations ( preds. iter ( ) . map ( |pred : PolyExistentialPredicate < ' _ > | {
243243 let pred = pred. with_self_ty ( tcx, tp_ty) ;
244244 // Lifetimes can only be 'static because of the bound on T
245245 let pred = pred. fold_with ( & mut ty:: BottomUpFolder {
@@ -252,7 +252,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
252252 } ) ;
253253 Obligation :: new ( tcx, ObligationCause :: dummy ( ) , param_env, pred)
254254 } ) ) ;
255- let type_impls_trait = ocx. select_all_or_error ( ) . is_empty ( ) ;
255+ let type_impls_trait = ocx. evaluate_obligations_error_on_ambiguity ( ) . is_empty ( ) ;
256256 // Since `assumed_wf_tys=[]` the choice of LocalDefId is irrelevant, so using the "default"
257257 let regions_are_valid = ocx. resolve_regions ( CRATE_DEF_ID , param_env, [ ] ) . is_empty ( ) ;
258258
0 commit comments