Rollup merge of #121745 - compiler-errors:refining-impl-trait-deeply-norm, r=lcnr

Deeply normalize obligations in `refining_impl_trait`

We somewhat awkwardly use semantic comparison when checking the `refining_impl_trait` lint. This relies on us being able to normalize bounds eagerly to avoid cases where an unnormalized alias is not considered equal to a normalized alias. Since `normalize` in the new solver is a noop, let's use `deeply_normalize` instead.

r? lcnr

cc ``@tmandry,`` this should fix your bug lol
This commit is contained in:
Jacob Pratt 2024-02-29 05:25:28 -05:00 committed by GitHub
commit 23351388d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 5 deletions

View file

@ -107,6 +107,15 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> {
self.register_infer_ok_obligations(infer_ok)
}
pub fn deeply_normalize<T: TypeFoldable<TyCtxt<'tcx>>>(
&self,
cause: &ObligationCause<'tcx>,
param_env: ty::ParamEnv<'tcx>,
value: T,
) -> Result<T, Vec<FulfillmentError<'tcx>>> {
self.infcx.at(cause, param_env).deeply_normalize(value, &mut **self.engine.borrow_mut())
}
/// Makes `expected <: actual`.
pub fn eq_exp<T>(
&self,