Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk · rust-lang-ci/rust@c703d11 (original) (raw)

`@@ -28,7 +28,6 @@ use rustc_hir::def::DefKind;

`

28

28

`use rustc_hir::def_id::DefId;

`

29

29

`use rustc_hir::lang_items::LangItem;

`

30

30

`use rustc_infer::infer::resolve::OpportunisticRegionResolver;

`

31

``

`-

use rustc_infer::traits::ObligationCauseCode;

`

32

31

`use rustc_middle::traits::select::OverflowError;

`

33

32

`use rustc_middle::ty::fold::{MaxUniverse, TypeFoldable, TypeFolder, TypeSuperFoldable};

`

34

33

`use rustc_middle::ty::subst::Subst;

`

`@@ -252,22 +251,10 @@ fn project_and_unify_type<'cx, 'tcx>(

`

252

251

`Err(InProgress) => return ProjectAndUnifyResult::Recursive,

`

253

252

`};

`

254

253

`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

`+

{

`

271

258

`Ok(InferOk { obligations: inferred_obligations, value: () }) => {

`

272

259

` obligations.extend(inferred_obligations);

`

273

260

`ProjectAndUnifyResult::Holds(obligations)

`