Change:
into causes an internal compiler panic This causes an internal compiler error: This seems related to , except this is using
:
This is not specific to . The following produces the same kind of error.
modify labels: +regression-from-stable-to-stable The ICE happens on stable regardless of having the feature gate or not (the ICE does not requires a nightly compiler to reproduce)

Discussion:
/// result. After this, no more unification operations should be /// done -- or the compiler will panic -- but it is legal to use /// `resolve_vars_if_possible` as well as `fully_resolve`. <ins> /// /// Make sure to call [`InferCtxt::process_registered_region_obligations`] /// first, or preferrably use [`InferCtxt::check_region_obligations_and_report_errors`] /// to do both of these operations together. </ins> pub fn resolve_regions_and_report_errors( &self, generic_param_scope: LocalDefId,

std::mem::take(&mut self.inner.borrow_mut().region_obligations) } <ins> /// NOTE: Prefer using [`InferCtxt::check_region_obligations_and_report_errors`] /// instead of calling this directly. /// </ins> /// Process the region obligations that must be proven (during /// `regionck`) for the given `body_id`, given information about /// the region bounds in scope and so forth. This function must be

} } <ins> /// Processes registered region obliations and resolves regions, reporting /// any errors if any were raised. Prefer using this function over manually /// calling `resolve_regions_and_report_errors`. </ins> pub fn check_region_obligations_and_report_errors( &self, generic_param_scope: LocalDefId,

let outlives_env = OutlivesEnvironment::new(param_env); infcx.process_registered_region_obligations(outlives_env.region_bound_pairs(), param_env); <del> let errors = infcx.resolve_regions(&outlives_env); if !errors.is_empty() { return false; } true </del> <ins> infcx.resolve_regions(&outlives_env).is_empty() </ins> } pub fn trait_ref_is_knowable<'tcx>(

} let outlives_environment = OutlivesEnvironment::new(param_env); <del> infcx .resolve_regions_and_report_errors(impl_c.def_id.expect_local(), &outlives_environment); </del> <ins> infcx.check_region_obligations_and_report_errors( impl_c.def_id.expect_local(), &outlives_environment, ); </ins> }); }

// Finally, resolve all regions. let outlives_env = OutlivesEnvironment::new(param_env); <del> infcx.resolve_regions_and_report_errors(impl_did, &outlives_env); </del> <ins> infcx.check_region_obligations_and_report_errors(impl_did, &outlives_env); </ins> } } _ => {

// Finally, resolve all regions. let outlives_env = OutlivesEnvironment::new(param_env); <del> infcx.resolve_regions_and_report_errors(impl_did, &outlives_env); </del> <ins> infcx.check_region_obligations_and_report_errors(impl_did, &outlives_env); </ins> CoerceUnsizedInfo { custom_kind: kind } })

implied_bounds, tcx.hir().local_def_id_to_hir_id(impl1_def_id), ); <del> infcx.process_registered_region_obligations(outlives_env.region_bound_pairs(), param_env); infcx.resolve_regions_and_report_errors(impl1_def_id, &outlives_env); </del> <ins> infcx.check_region_obligations_and_report_errors(impl1_def_id, &outlives_env); </ins> let Ok(impl2_substs) = infcx.fully_resolve(impl2_substs) else { let span = tcx.def_span(impl1_def_id); tcx.sess.emit_err(SubstsOnOverriddenImpl { span });

<ins> #![feature(coerce_unsized)] use std::any::Any; use std::ops::CoerceUnsized; struct Foo<T> { data: Box<T>, } impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {} //~^ ERROR the parameter type `T` may not live long enough fn main() {} </ins>

<ins> error[E0310]: the parameter type `T` may not live long enough --> $DIR/issue-53475.rs:10:1 | LL | impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds | help: consider adding an explicit lifetime bound... | LL | impl<T: 'static> CoerceUnsized<Foo<dyn Any>> for Foo<T> {} |       +++++++++ error: aborting due to previous error For more information about this error, try `rustc --explain E0310`. </ins>