rust/src/librustc_save_analysis
Mazdak Farrokhzad 62d1574876
Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj
[wg-async-await] Drop `async fn` arguments in async block

Fixes #54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis
2019-04-23 21:50:52 +02:00
..
Cargo.toml Switch to serde-enabled rls-* and update RLS appropriately 2019-04-21 12:52:07 +02:00
dump_visitor.rs HirIdify hir::Def 2019-04-14 09:30:02 +02:00
json_dumper.rs save-analysis: Use serde instead of libserialize to dump JSON data 2019-04-21 12:45:16 +02:00
lib.rs save-analysis: Use serde instead of libserialize to dump JSON data 2019-04-21 12:45:16 +02:00
sig.rs Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj 2019-04-23 21:50:52 +02:00
span_utils.rs librustc_save_analysis => 2018 2019-02-07 01:02:00 +09:00