Skip to content

Commit bacfa97

Browse files
Remove unnecessary body_expr_count
1 parent 71696e5 commit bacfa97

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

compiler/rustc_hir_analysis/src/check/region.rs

-4
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,6 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
824824
resolve_local(self, None, Some(body.value));
825825
}
826826

827-
if body.coroutine_kind.is_some() {
828-
self.scope_tree.body_expr_count.insert(body_id, self.expr_and_pat_count);
829-
}
830-
831827
// Restore context we had at the start.
832828
self.expr_and_pat_count = outer_ec;
833829
self.cx = outer_cx;

compiler/rustc_middle/src/middle/region.rs

-14
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,6 @@ pub struct ScopeTree {
307307
/// the values are still owned by their containing expressions. So
308308
/// we'll see that `&x`.
309309
pub yield_in_scope: FxHashMap<Scope, Vec<YieldData>>,
310-
311-
/// The number of visit_expr and visit_pat calls done in the body.
312-
/// Used to sanity check visit_expr/visit_pat call count when
313-
/// calculating coroutine interiors.
314-
pub body_expr_count: FxHashMap<hir::BodyId, usize>,
315310
}
316311

317312
/// Identifies the reason that a given expression is an rvalue candidate
@@ -408,20 +403,12 @@ impl ScopeTree {
408403
pub fn yield_in_scope(&self, scope: Scope) -> Option<&[YieldData]> {
409404
self.yield_in_scope.get(&scope).map(Deref::deref)
410405
}
411-
412-
/// Gives the number of expressions visited in a body.
413-
/// Used to sanity check visit_expr call count when
414-
/// calculating coroutine interiors.
415-
pub fn body_expr_count(&self, body_id: hir::BodyId) -> Option<usize> {
416-
self.body_expr_count.get(&body_id).copied()
417-
}
418406
}
419407

420408
impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
421409
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
422410
let ScopeTree {
423411
root_body,
424-
ref body_expr_count,
425412
ref parent_map,
426413
ref var_map,
427414
ref destruction_scopes,
@@ -430,7 +417,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
430417
} = *self;
431418

432419
root_body.hash_stable(hcx, hasher);
433-
body_expr_count.hash_stable(hcx, hasher);
434420
parent_map.hash_stable(hcx, hasher);
435421
var_map.hash_stable(hcx, hasher);
436422
destruction_scopes.hash_stable(hcx, hasher);

0 commit comments

Comments
 (0)