@@ -13,7 +13,7 @@ impl<'tcx> Cx<'tcx> {
13
13
// in order to get the lexical scoping correctly.
14
14
let stmts = self . mirror_stmts ( block. hir_id . local_id , block. stmts ) ;
15
15
let opt_destruction_scope =
16
- self . region_scope_tree . opt_destruction_scope ( block. hir_id . local_id , false ) ;
16
+ self . region_scope_tree . opt_destruction_scope ( block. hir_id . local_id ) ;
17
17
Block {
18
18
targeted_by_break : block. targeted_by_break ,
19
19
region_scope : region:: Scope {
@@ -47,8 +47,11 @@ impl<'tcx> Cx<'tcx> {
47
47
. enumerate ( )
48
48
. filter_map ( |( index, stmt) | {
49
49
let hir_id = stmt. kind . hir_id ( ) ;
50
- let opt_dxn_ext =
51
- self . region_scope_tree . opt_destruction_scope ( hir_id. local_id , true ) ;
50
+ let dxn_scope = region:: Scope {
51
+ id : hir_id. local_id ,
52
+ data : region:: ScopeData :: Destruction ,
53
+ for_stmt : true ,
54
+ } ;
52
55
match stmt. kind {
53
56
hir:: StmtKind :: Expr ( ref expr) | hir:: StmtKind :: Semi ( ref expr) => {
54
57
let stmt = Stmt {
@@ -60,7 +63,7 @@ impl<'tcx> Cx<'tcx> {
60
63
} ,
61
64
expr : self . mirror_expr ( expr) ,
62
65
} ,
63
- opt_destruction_scope : opt_dxn_ext ,
66
+ opt_destruction_scope : Some ( dxn_scope ) ,
64
67
} ;
65
68
Some ( self . thir . stmts . push ( stmt) )
66
69
}
@@ -111,7 +114,7 @@ impl<'tcx> Cx<'tcx> {
111
114
initializer : local. init . map ( |init| self . mirror_expr ( init) ) ,
112
115
lint_level : LintLevel :: Explicit ( local. hir_id ) ,
113
116
} ,
114
- opt_destruction_scope : opt_dxn_ext ,
117
+ opt_destruction_scope : Some ( dxn_scope ) ,
115
118
} ;
116
119
Some ( self . thir . stmts . push ( stmt) )
117
120
}
0 commit comments