We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 227f933 commit 0ad0142Copy full SHA for 0ad0142
compiler/rustc_hir_analysis/src/check/region.rs
@@ -849,13 +849,12 @@ impl<'tcx> Visitor<'tcx> for ScopeResolutionVisitor<'tcx> {
849
self.enter_body(body.value.hir_id, |this| {
850
if this.tcx.hir_body_owner_kind(owner_id).is_fn_or_closure() {
851
// The arguments and `self` are parented to the fn.
852
- this.cx.var_parent = this.cx.parent.take();
+ this.cx.var_parent = this.cx.parent;
853
for param in body.params {
854
this.visit_pat(param.pat);
855
}
856
857
// The body of the every fn is a root scope.
858
- this.cx.parent = this.cx.var_parent;
859
this.visit_expr(body.value)
860
} else {
861
// Only functions have an outer terminating (drop) scope, while
0 commit comments