Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. -- Regressed between ( 2022-07-17) .. ( 2022-07-21). ~Probably ~. Cc Edit: Regressed in Minimized from . Cc label regression-from-stable-to-nightly A-impl-trait <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Duplicate of
No wait, huh? That's another issue
This must've been broken before. That revert should not be able to cause a stable to nightly regression
I was wrong, bisection points to . I guess it is . Cc
claim

Discussion:
<del> use rustc_infer::infer::TyCtxtInferExt; </del> <ins> use rustc_infer::infer::{DefiningAnchor, TyCtxtInferExt}; </ins> use rustc_middle::ty::query::Providers; use rustc_middle::ty::{ParamEnvAnd, TyCtxt}; use rustc_span::source_map::DUMMY_SP;

canonical_goal: CanonicalPredicateGoal<'tcx>, ) -> Result<EvaluationResult, OverflowError> { debug!("evaluate_obligation(canonical_goal={:#?})", canonical_goal); <del> tcx.infer_ctxt().enter_with_canonical( </del> <ins> // HACK This bubble is required for this tests to pass: // impl-trait/issue99642.rs tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_with_canonical( </ins> DUMMY_SP, &canonical_goal, |ref infcx, goal, _canonical_inference_vars| {

use rustc_hir::def_id::DefId; use rustc_infer::infer::at::ToTrace; use rustc_infer::infer::canonical::{Canonical, QueryResponse}; <del> use rustc_infer::infer::{InferCtxt, TyCtxtInferExt}; </del> <ins> use rustc_infer::infer::{DefiningAnchor, InferCtxt, TyCtxtInferExt}; </ins> use rustc_infer::traits::TraitEngineExt as _; use rustc_middle::ty::query::Providers; use rustc_middle::ty::subst::{GenericArg, Subst, UserSelfTy, UserSubsts};

tcx: TyCtxt<'tcx>, canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>, ) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> { <del> tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |infcx, fulfill_cx, key| { type_op_prove_predicate_with_cause(infcx, fulfill_cx, key, ObligationCause::dummy()); Ok(()) }) </del> <ins> // HACK This bubble is required for this test to pass: // impl-trait/issue-99642.rs tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_canonical_trait_query( &canonicalized, |infcx, fulfill_cx, key| { type_op_prove_predicate_with_cause(infcx, fulfill_cx, key, ObligationCause::dummy()); Ok(()) }, ) </ins> } /// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,

<ins> // check-pass #![feature(type_alias_impl_trait)] type Opq = impl Sized; fn test() -> impl Iterator<Item = Opq> { Box::new(0..) as Box<dyn Iterator<Item = _>> } fn main(){} </ins>

<ins> // check-pass fn test() -> impl Iterator<Item = impl Sized> { Box::new(0..) as Box<dyn Iterator<Item = _>> } fn main() {} </ins>

<del> error[E0275]: overflow evaluating the requirement `<fn() -> Foo {foo} as FnOnce<()>>::Output == fn() -> Foo {foo}` </del> <ins> error[E0275]: overflow evaluating the requirement `fn() -> Foo {foo}: Sized` </ins> --> $DIR/issue-53398-cyclic-types.rs:5:13 | LL | fn foo() -> Foo { |             ^^^ <ins> | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`) </ins> error: aborting due to previous error