Combine identical alias arms
This commit is contained in:
parent
61adaf8187
commit
96cb18e864
29 changed files with 69 additions and 120 deletions
|
@ -216,8 +216,7 @@ 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::Alias(ty::Opaque, ty::AliasTy { def_id, substs })
|
||||
| ty::Alias(ty::Projection, ty::AliasTy { def_id, substs })
|
||||
| ty::Alias(_, ty::AliasTy { def_id, substs })
|
||||
| ty::Closure(def_id, substs)
|
||||
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),
|
||||
|
||||
|
|
|
@ -646,10 +646,9 @@ fn encode_ty<'tcx>(
|
|||
| ty::Error(..)
|
||||
| ty::GeneratorWitness(..)
|
||||
| ty::Infer(..)
|
||||
| ty::Alias(ty::Opaque, ..)
|
||||
| ty::Alias(..)
|
||||
| ty::Param(..)
|
||||
| ty::Placeholder(..)
|
||||
| ty::Alias(ty::Projection, ..) => {
|
||||
| ty::Placeholder(..) => {
|
||||
bug!("encode_ty: unexpected `{:?}`", ty.kind());
|
||||
}
|
||||
};
|
||||
|
@ -799,10 +798,9 @@ fn transform_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, options: TransformTyOptio
|
|||
| ty::Error(..)
|
||||
| ty::GeneratorWitness(..)
|
||||
| ty::Infer(..)
|
||||
| ty::Alias(ty::Opaque, ..)
|
||||
| ty::Alias(..)
|
||||
| ty::Param(..)
|
||||
| ty::Placeholder(..)
|
||||
| ty::Alias(ty::Projection, ..) => {
|
||||
| ty::Placeholder(..) => {
|
||||
bug!("transform_ty: unexpected `{:?}`", ty.kind());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -439,8 +439,7 @@ 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::Alias(ty::Opaque, ty::AliasTy { def_id, substs })
|
||||
| ty::Alias(ty::Projection, ty::AliasTy { def_id, substs })
|
||||
| ty::Alias(_, ty::AliasTy { def_id, substs })
|
||||
| ty::Closure(def_id, substs)
|
||||
| ty::Generator(def_id, substs, _) => {
|
||||
self = self.print_def_path(def_id, substs)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue