Fix impl Trait Lifetime Handling

After this change, impl Trait existentials are
desugared to a new `abstract type` definition
paired with a set of lifetimes to apply.

In-scope generics are included as parents of the
`abstract type` generics. Parent regions are
replaced with static, and parent regions
referenced in the `impl Trait` type are duplicated
at the end of the `abstract type`'s generics.
This commit is contained in:
Taylor Cramer 2017-10-15 13:43:06 -07:00
parent d0f8e2913a
commit bc4810d907
24 changed files with 884 additions and 133 deletions

View file

@ -1960,9 +1960,8 @@ impl Clean<Type> for hir::Ty {
}
}
TyBareFn(ref barefn) => BareFunction(box barefn.clean(cx)),
TyImplTraitExistential(ref bounds) |
TyImplTraitUniversal(_, ref bounds) =>
ImplTrait(bounds.clean(cx)),
TyImplTraitExistential(ref exist_ty, ref _lts) => ImplTrait(exist_ty.bounds.clean(cx)),
TyImplTraitUniversal(_, ref bounds) => ImplTrait(bounds.clean(cx)),
TyInfer | TyErr => Infer,
TyTypeof(..) => panic!("Unimplemented type {:?}", self.node),
}