Skip to content

Commit 5ced891

Browse files
authored
Update compiler/rustc_typeck/src/check/region.rs
1 parent 4c6074f commit 5ced891

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_typeck/src/check/region.rs

+5
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,11 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
797797

798798
/// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body;
799799
/// in the case of closures, this will be redirected to the enclosing function.
800+
///
801+
/// Performance: This is a query rather than a simple function to enable
802+
/// re-use in incremental scenarios. We may sometimes need to rerun the
803+
/// type checker even when the HIR hasn't changed, and in those cases
804+
/// we can avoid reconstructing the region scope tree.
800805
pub fn region_scope_tree(tcx: TyCtxt<'_>, def_id: DefId) -> &ScopeTree {
801806
let typeck_root_def_id = tcx.typeck_root_def_id(def_id);
802807
if typeck_root_def_id != def_id {

0 commit comments

Comments
 (0)