Skip to content

Commit 5e98e55

Browse files
authored
Rollup merge of #98419 - WaffleLapkin:remove_excess_rib, r=compiler-errors
Remove excess rib while resolving closures I've mentioned this on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60ClosureOrAsyncRibKind.60.20weirdness/near/286982959), in `rustc_resolve`, while resolving closures we add an excess `ClosureOrAsyncRibKind`. It's excess because we later add another one in `visit_fn`. I couldn't find a way in which removing this will break anything, all test seem to pass, etc. r? ``@compiler-errors`` cc ``@davidtwco``
2 parents d26b03c + 9730221 commit 5e98e55

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_resolve/src/late.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3514,7 +3514,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
35143514
})
35153515
});
35163516
}
3517-
ExprKind::Async(..) | ExprKind::Closure(..) => {
3517+
// For closures, ClosureOrAsyncRibKind is added in visit_fn
3518+
ExprKind::Closure(..) => visit::walk_expr(self, expr),
3519+
ExprKind::Async(..) => {
35183520
self.with_label_rib(ClosureOrAsyncRibKind, |this| visit::walk_expr(this, expr));
35193521
}
35203522
ExprKind::Repeat(ref elem, ref ct) => {

0 commit comments

Comments
 (0)