rust/src/libsyntax
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
..
attr Make check_name generic 2019-04-15 07:23:02 +02:00
diagnostics remove lookup_char_pos_adj 2019-04-05 23:16:09 +03:00
ext Introduce ArgSource for diagnostics. 2019-04-21 16:46:32 +01:00
parse Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj 2019-04-23 21:50:52 +02:00
print Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj 2019-04-23 21:50:52 +02:00
util rustc: doc comments 2019-02-10 23:42:32 +00:00
ast.rs Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj 2019-04-23 21:50:52 +02:00
build.rs Remove licenses 2018-12-25 21:08:33 -07:00
Cargo.toml Preallocate BUILTIN_ATTRIBUTES symbols and use a hash map instead of looping 2019-04-15 15:20:05 +02:00
config.rs Separate variant id and variant constructor id. 2019-03-24 12:10:16 +03:00
early_buffered_lints.rs make duplicate matcher bindings a hard error 2019-04-10 21:29:17 -05:00
entry.rs libsyntax => 2018 2019-02-07 02:33:01 +09:00
error_codes.rs Rename diagnositc_list into error_codes 2019-04-18 06:21:30 +09:00
feature_gate.rs Enable migrate mode by default on the 2015 edition 2019-04-21 20:50:02 +01:00
json.rs Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddyb 2019-04-17 10:31:30 +02:00
lib.rs Auto merge of #60025 - JohnTitor:rename-files, r=petrochenkov 2019-04-18 14:52:45 +00:00
mut_visit.rs Introduce ArgSource for diagnostics. 2019-04-21 16:46:32 +01:00
ptr.rs Fix fallout from #57667 2019-03-09 18:23:17 +09:00
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
show_span.rs Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
source_map.rs remove lookup_char_pos_adj 2019-04-05 23:16:09 +03:00
std_inject.rs Use Rc<[Symbol]> instead of Vec<Symbol> to reduce # of allocs 2019-02-11 15:08:17 +01:00
test.rs Fix comments around test harness generation 2019-04-17 12:02:04 +03:00
test_snippet.rs Remove double trailing newlines 2019-04-22 16:57:01 +01:00
tokenstream.rs Use SmallVec in TokenStreamBuilder. 2019-03-29 09:32:58 +11:00
visit.rs Introduce ArgSource for diagnostics. 2019-04-21 16:46:32 +01:00

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.

For more information about how these things work in rustc, see the rustc guide: