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``
This commit is contained in:
Yuki Okushi 2022-06-24 16:43:49 +09:00 committed by GitHub
commit 5e98e55668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3514,7 +3514,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
})
});
}
ExprKind::Async(..) | ExprKind::Closure(..) => {
// For closures, ClosureOrAsyncRibKind is added in visit_fn
ExprKind::Closure(..) => visit::walk_expr(self, expr),
ExprKind::Async(..) => {
self.with_label_rib(ClosureOrAsyncRibKind, |this| visit::walk_expr(this, expr));
}
ExprKind::Repeat(ref elem, ref ct) => {