]> git.lizzy.rs Git - rust.git/commit
Fix impl Trait Lifetime Handling
authorTaylor Cramer <cramertj@google.com>
Sun, 15 Oct 2017 20:43:06 +0000 (13:43 -0700)
committerTaylor Cramer <cramertj@google.com>
Fri, 17 Nov 2017 18:01:54 +0000 (10:01 -0800)
commitbc4810d907deef00ea5bd0124272cfcab3975e3c
tree14291c299a2c2c03333500a0952d7512398488ac
parentd0f8e2913a93573c78cddfd297944cff4eb4c41a
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.
24 files changed:
src/librustc/diagnostics.rs
src/librustc/hir/intravisit.rs
src/librustc/hir/lowering.rs
src/librustc/hir/mod.rs
src/librustc/hir/print.rs
src/librustc/ich/impls_hir.rs
src/librustc/middle/free_region.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/ty/subst.rs
src/librustc/util/ppaux.rs
src/librustc_metadata/encoder.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/check/writeback.rs
src/librustc_typeck/collect.rs
src/librustdoc/clean/mod.rs
src/test/compile-fail/E0657.rs [new file with mode: 0644]
src/test/compile-fail/impl-trait/lifetimes.rs [deleted file]
src/test/compile-fail/impl-trait/must_outlive_least_region_or_bound.rs [new file with mode: 0644]
src/test/compile-fail/impl-trait/needs_least_region_or_bound.rs [new file with mode: 0644]
src/test/compile-fail/impl-trait/type_parameters_captured.rs [new file with mode: 0644]
src/test/run-pass/impl-trait/lifetimes.rs [new file with mode: 0644]
src/test/ui/span/loan-extend.rs [deleted file]