@@ -28,7 +28,6 @@ use rustc_hir::def::DefKind;
2828use rustc_hir:: def_id:: DefId ;
2929use rustc_hir:: lang_items:: LangItem ;
3030use rustc_infer:: infer:: resolve:: OpportunisticRegionResolver ;
31- use rustc_infer:: traits:: ObligationCauseCode ;
3231use rustc_middle:: traits:: select:: OverflowError ;
3332use rustc_middle:: ty:: fold:: { MaxUniverse , TypeFoldable , TypeFolder , TypeSuperFoldable } ;
3433use rustc_middle:: ty:: subst:: Subst ;
@@ -252,22 +251,10 @@ fn project_and_unify_type<'cx, 'tcx>(
252251 Err ( InProgress ) => return ProjectAndUnifyResult :: Recursive ,
253252 } ;
254253 debug ! ( ?normalized, ?obligations, "project_and_unify_type result" ) ;
255- let actual = obligation. predicate . term ;
256- // HACK: lazy TAIT would regress src/test/ui/impl-trait/nested-return-type2.rs, so we add
257- // a back-compat hack hat converts the RPITs into inference vars, just like they were before
258- // lazy TAIT.
259- // This does not affect TAITs in general, as tested in the nested-return-type-tait* tests.
260- let InferOk { value : actual, obligations : new } =
261- selcx. infcx ( ) . replace_opaque_types_with_inference_vars (
262- actual,
263- obligation. cause . body_id ,
264- obligation. cause . span ,
265- ObligationCauseCode :: MiscObligation ,
266- obligation. param_env ,
267- ) ;
268- obligations. extend ( new) ;
269-
270- match infcx. at ( & obligation. cause , obligation. param_env ) . eq ( normalized, actual) {
254+ match infcx
255+ . at ( & obligation. cause , obligation. param_env )
256+ . eq ( normalized, obligation. predicate . term )
257+ {
271258 Ok ( InferOk { obligations : inferred_obligations, value : ( ) } ) => {
272259 obligations. extend ( inferred_obligations) ;
273260 ProjectAndUnifyResult :: Holds ( obligations)
0 commit comments