Continue folding in query normalizer on weak aliases
This commit is contained in:
@@ -322,8 +322,12 @@ impl<'cx, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'cx, 'tcx>
|
||||
};
|
||||
// `tcx.normalize_projection_ty` may normalize to a type that still has
|
||||
// unevaluated consts, so keep normalizing here if that's the case.
|
||||
if res != ty && res.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION) {
|
||||
res.try_super_fold_with(self)?
|
||||
// Similarly, `tcx.normalize_weak_ty` will only unwrap one layer of type
|
||||
// and we need to continue folding it to reveal the TAIT behind it.
|
||||
if res != ty
|
||||
&& (res.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION) || kind == ty::Weak)
|
||||
{
|
||||
res.try_fold_with(self)?
|
||||
} else {
|
||||
res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user