Combine projection and opaque into alias

This commit is contained in:
Michael Goulet
2022-11-26 21:51:55 +00:00
parent c13bd83528
commit 61adaf8187
104 changed files with 387 additions and 381 deletions

View File

@@ -571,7 +571,7 @@ impl<'tcx> TypeFolder<'tcx> for ImplTraitInTraitCollector<'_, 'tcx> {
}
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
if let ty::Projection(proj) = ty.kind()
if let ty::Alias(ty::Projection, proj) = ty.kind()
&& self.tcx().def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder
{
if let Some((ty, _)) = self.types.get(&proj.def_id) {
@@ -1734,7 +1734,7 @@ pub fn check_type_bounds<'tcx>(
let normalize_param_env = {
let mut predicates = param_env.caller_bounds().iter().collect::<Vec<_>>();
match impl_ty_value.kind() {
ty::Projection(proj)
ty::Alias(ty::Projection, proj)
if proj.def_id == trait_ty.def_id && proj.substs == rebased_substs =>
{
// Don't include this predicate if the projected type is