@@ -13,7 +13,7 @@ impl<'tcx> Cx<'tcx> {
1313 // in order to get the lexical scoping correctly.
1414 let stmts = self . mirror_stmts ( block. hir_id . local_id , block. stmts ) ;
1515 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 ) ;
1717 Block {
1818 targeted_by_break : block. targeted_by_break ,
1919 region_scope : region:: Scope {
@@ -47,8 +47,11 @@ impl<'tcx> Cx<'tcx> {
4747 . enumerate ( )
4848 . filter_map ( |( index, stmt) | {
4949 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+ } ;
5255 match stmt. kind {
5356 hir:: StmtKind :: Expr ( ref expr) | hir:: StmtKind :: Semi ( ref expr) => {
5457 let stmt = Stmt {
@@ -60,7 +63,7 @@ impl<'tcx> Cx<'tcx> {
6063 } ,
6164 expr : self . mirror_expr ( expr) ,
6265 } ,
63- opt_destruction_scope : opt_dxn_ext ,
66+ opt_destruction_scope : Some ( dxn_scope ) ,
6467 } ;
6568 Some ( self . thir . stmts . push ( stmt) )
6669 }
@@ -111,7 +114,7 @@ impl<'tcx> Cx<'tcx> {
111114 initializer : local. init . map ( |init| self . mirror_expr ( init) ) ,
112115 lint_level : LintLevel :: Explicit ( local. hir_id ) ,
113116 } ,
114- opt_destruction_scope : opt_dxn_ext ,
117+ opt_destruction_scope : Some ( dxn_scope ) ,
115118 } ;
116119 Some ( self . thir . stmts . push ( stmt) )
117120 }
0 commit comments