]> git.lizzy.rs Git - rust.git/commit
Added DestructionScope variant to CodeExtent, representing the area
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Tue, 25 Nov 2014 16:02:20 +0000 (17:02 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 11 Feb 2015 07:50:27 +0000 (08:50 +0100)
commit81383bd8691c0915e66abaca845e508b6edc4851
tree8bda86fc350ae7caf6c3564c0a9aedf7c5db1219
parentbdb9f3e26666ef7cd0c3b78e4ddba886d7c49e82
Added DestructionScope variant to CodeExtent, representing the area
immediately surrounding a node that is a terminating_scope
(e.g. statements, looping forms) during which the destructors run (the
destructors for temporaries from the execution of that node, that is).

Introduced DestructionScopeData newtype wrapper around ast::NodeId, to
preserve invariant that FreeRegion and ScopeChain::BlockScope carry
destruction scopes (rather than arbitrary CodeExtents).

Insert DestructionScope and block Remainder into enclosing CodeExtents
hierarchy.

Add more doc for DestructionScope, complete with ASCII art.

Switch to constructing DestructionScope rather than Misc in a number
of places, mostly related to `ty::ReFree` creation, and use
destruction-scopes of node-ids at various calls to
liberate_late_bound_regions.

middle::resolve_lifetime: Map BlockScope to DestructionScope in `fn resolve_free_lifetime`.

Add the InnermostDeclaringBlock and InnermostEnclosingExpr enums that
are my attempt to clarify the region::Context structure, and that
later commmts build upon.

Improve the debug output for `CodeExtent` attached to `ty::Region::ReScope`.

Loosened an assertion in `rustc_trans::trans::cleanup` to account for
`DestructionScope`.  (Perhaps this should just be switched entirely
over to `DestructionScope`, rather than allowing for either `Misc` or
`DestructionScope`.)

----

Even though the DestructionScope is new, this particular commit should
not actually change the semantics of any current code.
18 files changed:
src/librustc/metadata/tydecode.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/astencode.rs
src/librustc/middle/infer/error_reporting.rs
src/librustc/middle/infer/region_inference/mod.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/region.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/ty.rs
src/librustc/util/ppaux.rs
src/librustc_borrowck/borrowck/gather_loans/mod.rs
src/librustc_driver/test.rs
src/librustc_trans/trans/cleanup.rs
src/librustc_typeck/check/closure.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/wf.rs
src/librustc_typeck/collect.rs