adjust desugaring for async fn to correct drop order#64525
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
6b2fa9e to
edb1a6f
Compare
|
r? @cramertj (I guess) |
Old desugaring, given a user function body { $stmts; $expr }
```
{
let $param_pattern0 = $raw_param0;
...
let $param_patternN = $raw_paramN;
$stmts;
$expr
}
```
New desugaring:
```
{
let $param_pattern0 = $raw_param0;
...
let $param_patternN = $raw_paramN;
drop-temps {
$stmts;
$expr
}
}
```
The drop-temps is an internal bit of HIR that drops temporaries from
the resulting expression, but it should be equivalent to `return {
$stmts; $expr }`.
edb1a6f to
00d1590
Compare
|
@cramertj is on vacation -- maybe @davidtwco feels up to reviewing this? r? @davidtwco If you don't, though, let me know and we'll find somebody else. =) |
|
This looks correct to me. If no reviewer gets a chance to see it in a timely manner, r=me. |
|
@bors p=1 |
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
bbf0439 to
291fb31
Compare
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
davidtwco
left a comment
There was a problem hiding this comment.
LGTM! r=me when CI is passing.
DropTemps(...) looks like a function, this looks like wacko special stuff
291fb31 to
2d8b10f
Compare
davidtwco
left a comment
There was a problem hiding this comment.
Oh, just remembered, will the reference need updated with this change? rust-lang/reference#674 is still open from the initial change.
|
@bors r=davidtwco |
|
📌 Commit 2d8b10f has been approved by |
I was planning to take a look at the reference and decide what needed to be updated. |
… r=davidtwco
adjust desugaring for async fn to correct drop order
Old desugaring, given a user function body `{ $stmts; $expr }`
```
{
let $param_pattern0 = $raw_param0;
...
let $param_patternN = $raw_paramN;
$stmts;
$expr
}
```
New desugaring:
```
{
let $param_pattern0 = $raw_param0;
...
let $param_patternN = $raw_paramN;
drop-temps {
$stmts;
$expr
}
}
```
The drop-temps is an internal bit of HIR that drops temporaries from the resulting expression, but it should be equivalent to `return { $stmts; $expr }`.
Fixes #64512
Fixes #64391
|
☀️ Test successful - checks-azure |
Old desugaring, given a user function body
{ $stmts; $expr }New desugaring:
The drop-temps is an internal bit of HIR that drops temporaries from the resulting expression, but it should be equivalent to
return { $stmts; $expr }.Fixes #64512
Fixes #64391