Skip to content

Commit 3a06a93

Browse files
authored
Rollup merge of rust-lang#61413 - davidtwco:async-argument-order-in-a-sane-way, r=eddyb
Re-implement async fn drop order lowering This PR re-implements the async fn drop order lowering changes so that it all takes place in HIR lowering, building atop the work done by @eddyb to refactor `Res::Upvar`. Previously, this types involved in the lowering were constructed in libsyntax as they had to be used during name resolution and HIR lowering. This was awful because none of that logic should have existed in libsyntax. This commit also changes `ArgSource` to keep a `HirId` to the original argument pattern rather than a cloned copy of the pattern. Only b7aa4ed and 71fb8fa should be reviewed, any other commits are from rust-lang#61276 (though 447e336 might end up staying in this PR). As a nice side effect, it also fixes rust-lang#61187 (cc rust-lang#61192). r? @eddyb cc @cramertj
2 parents 1563514 + 2bb92aa commit 3a06a93

File tree

29 files changed

+361
-712
lines changed

29 files changed

+361
-712
lines changed

src/librustc/hir/intravisit.rs

-10
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ pub trait Visitor<'v> : Sized {
262262
fn visit_pat(&mut self, p: &'v Pat) {
263263
walk_pat(self, p)
264264
}
265-
fn visit_argument_source(&mut self, s: &'v ArgSource) {
266-
walk_argument_source(self, s)
267-
}
268265
fn visit_anon_const(&mut self, c: &'v AnonConst) {
269266
walk_anon_const(self, c)
270267
}
@@ -402,17 +399,10 @@ pub fn walk_body<'v, V: Visitor<'v>>(visitor: &mut V, body: &'v Body) {
402399
for argument in &body.arguments {
403400
visitor.visit_id(argument.hir_id);
404401
visitor.visit_pat(&argument.pat);
405-
visitor.visit_argument_source(&argument.source);
406402
}
407403
visitor.visit_expr(&body.value);
408404
}
409405

410-
pub fn walk_argument_source<'v, V: Visitor<'v>>(visitor: &mut V, source: &'v ArgSource) {
411-
if let ArgSource::AsyncFn(pat) = source {
412-
visitor.visit_pat(pat);
413-
}
414-
}
415-
416406
pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local) {
417407
// Intentionally visiting the expr first - the initialization expr
418408
// dominates the local's definition.

0 commit comments

Comments
 (0)