We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c6074f commit 5ced891Copy full SHA for 5ced891
compiler/rustc_typeck/src/check/region.rs
@@ -797,6 +797,11 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
797
798
/// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body;
799
/// 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.
805
pub fn region_scope_tree(tcx: TyCtxt<'_>, def_id: DefId) -> &ScopeTree {
806
let typeck_root_def_id = tcx.typeck_root_def_id(def_id);
807
if typeck_root_def_id != def_id {
0 commit comments