diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2022-05-26 10:44:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-26 10:44:29 -0400 |
| commit | 5ced8918fa311d8add4e72323070ee6a2eaad124 (patch) | |
| tree | f689737329f80faf24db6a17b756878549fdc8a5 | |
| parent | 4c6074fbb03d2cb3d175a8f71606fc264e30e8d3 (diff) | |
| download | rust-5ced8918fa311d8add4e72323070ee6a2eaad124.tar.gz rust-5ced8918fa311d8add4e72323070ee6a2eaad124.zip | |
Update compiler/rustc_typeck/src/check/region.rs
| -rw-r--r-- | compiler/rustc_typeck/src/check/region.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/check/region.rs b/compiler/rustc_typeck/src/check/region.rs index 9e94511fdc4..f4ec049a203 100644 --- a/compiler/rustc_typeck/src/check/region.rs +++ b/compiler/rustc_typeck/src/check/region.rs @@ -797,6 +797,11 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> { /// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body; /// in the case of closures, this will be redirected to the enclosing function. +/// +/// Performance: This is a query rather than a simple function to enable +/// re-use in incremental scenarios. We may sometimes need to rerun the +/// type checker even when the HIR hasn't changed, and in those cases +/// we can avoid reconstructing the region scope tree. pub fn region_scope_tree(tcx: TyCtxt<'_>, def_id: DefId) -> &ScopeTree { let typeck_root_def_id = tcx.typeck_root_def_id(def_id); if typeck_root_def_id != def_id { |
