1
Fork 0

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

@ -216,8 +216,8 @@ impl<'tcx> Printer<'tcx> for &mut SymbolPrinter<'tcx> {
match *ty.kind() {
// Print all nominal types as paths (unlike `pretty_print_type`).
ty::FnDef(def_id, substs)
| ty::Opaque(ty::AliasTy { def_id, substs })
| ty::Projection(ty::AliasTy { def_id, substs })
| ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs })
| ty::Alias(ty::Projection, ty::AliasTy { def_id, substs })
| ty::Closure(def_id, substs)
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),
@ -287,11 +287,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolPrinter<'tcx> {
// Similar to `pretty_path_qualified`, but for the other
// types that are printed as paths (see `print_type` above).
match self_ty.kind() {
ty::FnDef(..)
| ty::Opaque(..)
| ty::Projection(_)
| ty::Closure(..)
| ty::Generator(..)
ty::FnDef(..) | ty::Alias(..) | ty::Closure(..) | ty::Generator(..)
if trait_ref.is_none() =>
{
self.print_type(self_ty)

View file

@ -646,10 +646,10 @@ fn encode_ty<'tcx>(
| ty::Error(..)
| ty::GeneratorWitness(..)
| ty::Infer(..)
| ty::Opaque(..)
| ty::Alias(ty::Opaque, ..)
| ty::Param(..)
| ty::Placeholder(..)
| ty::Projection(..) => {
| ty::Alias(ty::Projection, ..) => {
bug!("encode_ty: unexpected `{:?}`", ty.kind());
}
};
@ -799,10 +799,10 @@ fn transform_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, options: TransformTyOptio
| ty::Error(..)
| ty::GeneratorWitness(..)
| ty::Infer(..)
| ty::Opaque(..)
| ty::Alias(ty::Opaque, ..)
| ty::Param(..)
| ty::Placeholder(..)
| ty::Projection(..) => {
| ty::Alias(ty::Projection, ..) => {
bug!("transform_ty: unexpected `{:?}`", ty.kind());
}
}

View file

@ -439,8 +439,8 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
// Mangle all nominal types as paths.
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), substs)
| ty::FnDef(def_id, substs)
| ty::Opaque(ty::AliasTy { def_id, substs })
| ty::Projection(ty::AliasTy { def_id, substs })
| ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs })
| ty::Alias(ty::Projection, ty::AliasTy { def_id, substs })
| ty::Closure(def_id, substs)
| ty::Generator(def_id, substs, _) => {
self = self.print_def_path(def_id, substs)?;