55
66use rustc_infer:: infer:: TyCtxtInferExt ;
77use rustc_infer:: traits:: { FulfillmentErrorCode , TraitEngineExt as _} ;
8- use rustc_middle:: traits:: { CodegenObligationError , DefiningAnchor } ;
8+ use rustc_middle:: traits:: CodegenObligationError ;
99use rustc_middle:: ty:: { self , TyCtxt } ;
1010use rustc_trait_selection:: traits:: error_reporting:: TypeErrCtxtExt ;
1111use rustc_trait_selection:: traits:: {
@@ -29,13 +29,7 @@ pub fn codegen_select_candidate<'tcx>(
2929
3030 // Do the initial selection for the obligation. This yields the
3131 // shallow result we are looking for -- that is, what specific impl.
32- let infcx = tcx
33- . infer_ctxt ( )
34- . ignoring_regions ( )
35- . with_opaque_type_inference ( DefiningAnchor :: Bubble )
36- . build ( ) ;
37- //~^ HACK `Bubble` is required for
38- // this test to pass: type-alias-impl-trait/assoc-projection-ice.rs
32+ let infcx = tcx. infer_ctxt ( ) . ignoring_regions ( ) . build ( ) ;
3933 let mut selcx = SelectionContext :: new ( & infcx) ;
4034
4135 let obligation_cause = ObligationCause :: dummy ( ) ;
@@ -79,10 +73,5 @@ pub fn codegen_select_candidate<'tcx>(
7973 let impl_source = infcx. resolve_vars_if_possible ( impl_source) ;
8074 let impl_source = infcx. tcx . erase_regions ( impl_source) ;
8175
82- // Opaque types may have gotten their hidden types constrained, but we can ignore them safely
83- // as they will get constrained elsewhere, too.
84- // (ouz-a) This is required for `type-alias-impl-trait/assoc-projection-ice.rs` to pass
85- let _ = infcx. take_opaque_types ( ) ;
86-
8776 Ok ( & * tcx. arena . alloc ( impl_source) )
8877}
0 commit comments