1
Fork 0

Deeply normalize args for implied bounds

This commit is contained in:
Michael Goulet 2025-01-25 21:39:59 +00:00
parent a02a982ffc
commit ce0c952e96
2 changed files with 23 additions and 1 deletions

View file

@ -264,7 +264,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
} }
let TypeOpOutput { output: norm_ty, constraints: constraints_normalize, .. } = let TypeOpOutput { output: norm_ty, constraints: constraints_normalize, .. } =
param_env param_env
.and(type_op::normalize::Normalize { value: ty }) .and(DeeplyNormalize { value: ty })
.fully_perform(self.infcx, span) .fully_perform(self.infcx, span)
.unwrap_or_else(|guar| TypeOpOutput { .unwrap_or_else(|guar| TypeOpOutput {
output: Ty::new_error(self.infcx.tcx, guar), output: Ty::new_error(self.infcx.tcx, guar),

View file

@ -0,0 +1,22 @@
//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
// Make sure that we can normalize `<T as Ref<'a>>::Assoc` to `&'a T` and get
// its implied bounds.
trait Ref<'a> {
type Assoc;
}
impl<'a, T> Ref<'a> for T where T: 'a {
type Assoc = &'a T;
}
fn outlives<'a, T: 'a>() {}
fn test<'a, T>(_: <T as Ref<'a>>::Assoc) {
outlives::<'a, T>();
}
fn main() {}