File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/librustc_mir/borrow_check/nll/type_check/liveness Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,20 @@ use rustc_data_structures::fx::FxHashMap;
28
28
use std:: rc:: Rc ;
29
29
use util:: liveness:: LiveVariableMap ;
30
30
31
+ /// This is the heart of the liveness computation. For each variable X
32
+ /// that requires a liveness computation, it walks over all the uses
33
+ /// of X and does a reverse depth-first search ("trace") through the
34
+ /// MIR. This search stops when we find a definition of that variable.
35
+ /// The points visited in this search is the USE-LIVE set for the variable;
36
+ /// of those points is added to all the regions that appear in the variable's
37
+ /// type.
38
+ ///
39
+ /// We then also walks through each *drop* of those variables and does
40
+ /// another search, stopping when we reach a use or definition. This
41
+ /// is the DROP-LIVE set of points. Each of the points in the
42
+ /// DROP-LIVE set are to the liveness sets for regions found in the
43
+ /// `dropck_outlives` result of the variable's type (in particular,
44
+ /// this respects `#[may_dangle]` annotations).
31
45
pub ( super ) fn trace (
32
46
typeck : & mut TypeChecker < ' _ , ' gcx , ' tcx > ,
33
47
mir : & Mir < ' tcx > ,
You can’t perform that action at this time.
0 commit comments