1
Fork 0

AliasTy::new instead of tcx method

This commit is contained in:
lcnr 2023-10-18 13:57:19 +02:00
parent 6d7160ce97
commit 306a7ea8b4
15 changed files with 46 additions and 39 deletions

View file

@ -448,7 +448,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
debug!(?args_trait_ref_and_assoc_item);
tcx.mk_alias_ty(assoc_item.def_id, args_trait_ref_and_assoc_item)
ty::AliasTy::new(tcx, assoc_item.def_id, args_trait_ref_and_assoc_item)
})
};

View file

@ -437,7 +437,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
);
let quiet_projection_ty =
tcx.mk_alias_ty(projection_ty.def_id, args_with_infer_self);
ty::AliasTy::new(tcx, projection_ty.def_id, args_with_infer_self);
let term = pred.skip_binder().term;

View file

@ -916,7 +916,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// Type aliases defined in crates that have the
// feature `lazy_type_alias` enabled get encoded as a type alias that normalization will
// then actually instantiate the where bounds of.
let alias_ty = tcx.mk_alias_ty(did, args);
let alias_ty = ty::AliasTy::new(tcx, did, args);
Ty::new_alias(tcx, ty::Weak, alias_ty)
} else {
tcx.at(span).type_of(did).instantiate(tcx, args)
@ -1718,7 +1718,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
.chain(args.into_iter().skip(parent_args.len())),
);
let ty = Ty::new_alias(tcx, ty::Inherent, tcx.mk_alias_ty(assoc_item, args));
let ty = Ty::new_alias(tcx, ty::Inherent, ty::AliasTy::new(tcx, assoc_item, args));
return Ok(Some((ty, assoc_item)));
}

View file

@ -2286,7 +2286,7 @@ pub(super) fn check_type_bounds<'tcx>(
_ => predicates.push(
ty::Binder::bind_with_vars(
ty::ProjectionPredicate {
projection_ty: tcx.mk_alias_ty(trait_ty.def_id, rebased_args),
projection_ty: ty::AliasTy::new(tcx, trait_ty.def_id, rebased_args),
term: normalize_impl_ty.into(),
},
bound_vars,