about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-23 21:50:52 +0200
committerGitHub <noreply@github.com>2019-04-23 21:50:52 +0200
commit62d1574876f5531bce1b267e62dff520d7adcbbb (patch)
treedf1cbb9f6f71a431a0d89164abcd9db6075a4955 /src/test/ui/thinlto
parent4eff8526a789e0dfa8b97f7dec91b7b5c18e8544 (diff)
parent119e67ac6b7d72c2b314777ba36b2191cbfa7309 (diff)
downloadrust-62d1574876f5531bce1b267e62dff520d7adcbbb.tar.gz
rust-62d1574876f5531bce1b267e62dff520d7adcbbb.zip
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
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions