1
Fork 0

squash OpaqueTy and ProjectionTy into AliasTy

This commit is contained in:
Michael Goulet 2022-11-26 21:32:01 +00:00
parent 5c6afb850c
commit c13bd83528
66 changed files with 182 additions and 197 deletions

View file

@ -83,7 +83,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
ConstValue::from_machine_usize(adt.variants().len() as u64, &tcx)
}
ty::Projection(_)
| ty::Opaque(ty::OpaqueTy { def_id: _, substs: _ })
| ty::Opaque(ty::AliasTy { def_id: _, substs: _ })
| ty::Param(_)
| ty::Placeholder(_)
| ty::Infer(_) => throw_inval!(TooGeneric),

View file

@ -241,7 +241,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
};
let kind = match parent_ty.ty.kind() {
&ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
&ty::Opaque(ty::AliasTy { def_id, substs }) => {
self.tcx.bound_type_of(def_id).subst(self.tcx, substs).kind()
}
kind => kind,

View file

@ -58,8 +58,8 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
// Types with identity (print the module path).
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), substs)
| ty::FnDef(def_id, substs)
| ty::Opaque(ty::OpaqueTy { def_id, substs })
| ty::Projection(ty::ProjectionTy { def_id, substs })
| ty::Opaque(ty::AliasTy { def_id, substs })
| ty::Projection(ty::AliasTy { def_id, substs })
| ty::Closure(def_id, substs)
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),
ty::Foreign(def_id) => self.print_def_path(def_id, &[]),