@@ -342,7 +342,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
342
342
) -> ImplSourceObjectData < ' tcx , PredicateObligation < ' tcx > > {
343
343
debug ! ( "confirm_object_candidate({:?})" , obligation) ;
344
344
345
- let self_ty = self . infcx . replace_bound_vars_with_placeholders ( & obligation. self_ty ( ) ) ;
345
+ let self_ty = self . infcx . shallow_resolve ( obligation. self_ty ( ) ) ;
346
+ let self_ty = self . infcx . replace_bound_vars_with_placeholders ( & self_ty) ;
346
347
let data = match self_ty. kind ( ) {
347
348
ty:: Dynamic ( data, ..) => data,
348
349
_ => span_bug ! ( obligation. cause. span, "object candidate with non-object" ) ,
@@ -448,7 +449,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
448
449
)
449
450
. map_bound ( |( trait_ref, _) | trait_ref) ;
450
451
451
- let Normalized { value : trait_ref, obligations } = ensure_sufficient_stack ( || {
452
+ let Normalized { value : trait_ref, mut obligations } = ensure_sufficient_stack ( || {
452
453
project:: normalize_with_depth (
453
454
self ,
454
455
obligation. param_env ,
@@ -458,12 +459,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
458
459
)
459
460
} ) ;
460
461
461
- self . confirm_poly_trait_refs (
462
+ obligations . extend ( self . confirm_poly_trait_refs (
462
463
obligation. cause . clone ( ) ,
463
464
obligation. param_env ,
464
465
obligation. predicate . to_poly_trait_ref ( ) ,
465
466
trait_ref,
466
- ) ?;
467
+ ) ?) ;
467
468
Ok ( ImplSourceFnPointerData { fn_ty : self_ty, nested : obligations } )
468
469
}
469
470
0 commit comments