rust/compiler/rustc_ast_lowering/src
bors 3cfa4def7c Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk
Inherit lifetimes for async fn instead of duplicating them.

The current desugaring of `async fn foo<'a>(&usize) -> &u8` is equivalent to
```rust
fn foo<'a, '0>(&'0 usize) -> foo<'static, 'static>::Opaque<'a, '0, '_>;
type foo<'_a, '_0>::Opaque<'a, '0, '1> = impl Future<Output = &'1 u8>;
```
following the RPIT model.

Duplicating all the inherited lifetime parameters and setting the inherited version to `'static` makes lowering more complex and causes issues like #61949. This PR removes the duplication of inherited lifetimes to directly use
```rust
fn foo<'a, '0>(&'0 usize) -> foo<'a, '0>::Opaque<'_>;
type foo<'a, '0>::Opaque<'1> = impl Future<Output = &'1 u8>;
```
following the TAIT model.

Fixes https://github.com/rust-lang/rust/issues/61949
2022-02-12 21:42:10 +00:00
..
asm.rs Fix incorrect register conflict detection in asm! 2022-02-10 18:04:09 +00:00
block.rs
expr.rs Rollup merge of #93103 - estebank:await-span, r=nagisa 2022-01-23 01:09:43 +01:00
index.rs Replace NestedVisitorMap with NestedFilter 2022-01-16 16:02:36 -06:00
item.rs Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakis 2022-02-09 14:12:22 +09:00
lib.rs Inherit lifetimes for async fn instead of duplicating them. 2022-02-12 01:26:11 +01:00
pat.rs Move PatKind::Lit checking from ast_validation to ast lowering 2022-01-01 15:10:43 -05:00
path.rs Use Term in ProjectionPredicate 2022-01-17 17:44:56 +00:00