@@ -31,9 +31,9 @@ impl<'tcx> Cx<'tcx> {
31
31
}
32
32
33
33
pub ( super ) fn mirror_expr_inner ( & mut self , hir_expr : & ' tcx hir:: Expr < ' tcx > ) -> ExprId {
34
- let temp_lifetime = self . region_scope_tree . temporary_scope ( hir_expr. hir_id . local_id ) ;
34
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( hir_expr. hir_id . local_id , false ) ;
35
35
let expr_scope =
36
- region:: Scope { id : hir_expr. hir_id . local_id , data : region:: ScopeData :: Node } ;
36
+ region:: Scope { id : hir_expr. hir_id . local_id , data : region:: ScopeData :: Node , for_stmt : false } ;
37
37
38
38
debug ! ( "Expr::make_mirror(): id={}, span={:?}" , hir_expr. hir_id, hir_expr. span) ;
39
39
@@ -59,7 +59,7 @@ impl<'tcx> Cx<'tcx> {
59
59
60
60
// Finally, create a destruction scope, if any.
61
61
if let Some ( region_scope) =
62
- self . region_scope_tree . opt_destruction_scope ( hir_expr. hir_id . local_id )
62
+ self . region_scope_tree . opt_destruction_scope ( hir_expr. hir_id . local_id , false )
63
63
{
64
64
expr = Expr {
65
65
temp_lifetime,
@@ -150,7 +150,7 @@ impl<'tcx> Cx<'tcx> {
150
150
151
151
fn make_mirror_unadjusted ( & mut self , expr : & ' tcx hir:: Expr < ' tcx > ) -> Expr < ' tcx > {
152
152
let expr_ty = self . typeck_results ( ) . expr_ty ( expr) ;
153
- let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id ) ;
153
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id , false ) ;
154
154
155
155
let kind = match expr. kind {
156
156
// Here comes the interesting stuff:
@@ -499,7 +499,7 @@ impl<'tcx> Cx<'tcx> {
499
499
) ,
500
500
} ;
501
501
let temp_lifetime =
502
- self . region_scope_tree . temporary_scope ( expr. hir_id . local_id ) ;
502
+ self . region_scope_tree . temporary_scope ( expr. hir_id . local_id , false ) ;
503
503
let res = self . typeck_results ( ) . qpath_res ( qpath, expr. hir_id ) ;
504
504
let ty;
505
505
match res {
@@ -579,14 +579,14 @@ impl<'tcx> Cx<'tcx> {
579
579
}
580
580
hir:: ExprKind :: Break ( dest, ref value) => match dest. target_id {
581
581
Ok ( target_id) => ExprKind :: Break {
582
- label : region:: Scope { id : target_id. local_id , data : region:: ScopeData :: Node } ,
582
+ label : region:: Scope { id : target_id. local_id , data : region:: ScopeData :: Node , for_stmt : false , } ,
583
583
value : value. as_ref ( ) . map ( |value| self . mirror_expr ( value) ) ,
584
584
} ,
585
585
Err ( err) => bug ! ( "invalid loop id for break: {}" , err) ,
586
586
} ,
587
587
hir:: ExprKind :: Continue ( dest) => match dest. target_id {
588
588
Ok ( loop_id) => ExprKind :: Continue {
589
- label : region:: Scope { id : loop_id. local_id , data : region:: ScopeData :: Node } ,
589
+ label : region:: Scope { id : loop_id. local_id , data : region:: ScopeData :: Node , for_stmt : false , } ,
590
590
} ,
591
591
Err ( err) => bug ! ( "invalid loop id for continue: {}" , err) ,
592
592
} ,
@@ -601,7 +601,7 @@ impl<'tcx> Cx<'tcx> {
601
601
} ,
602
602
hir:: ExprKind :: Loop ( ref body, ..) => {
603
603
let block_ty = self . typeck_results ( ) . node_type ( body. hir_id ) ;
604
- let temp_lifetime = self . region_scope_tree . temporary_scope ( body. hir_id . local_id ) ;
604
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( body. hir_id . local_id , false ) ;
605
605
let block = self . mirror_block ( body) ;
606
606
let body = self . thir . exprs . push ( Expr {
607
607
ty : block_ty,
@@ -800,7 +800,7 @@ impl<'tcx> Cx<'tcx> {
800
800
span : Span ,
801
801
overloaded_callee : Option < ( DefId , SubstsRef < ' tcx > ) > ,
802
802
) -> Expr < ' tcx > {
803
- let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id ) ;
803
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id , false ) ;
804
804
let ( def_id, substs, user_ty) = match overloaded_callee {
805
805
Some ( ( def_id, substs) ) => ( def_id, substs, None ) ,
806
806
None => {
@@ -837,7 +837,7 @@ impl<'tcx> Cx<'tcx> {
837
837
} ) ,
838
838
body : self . mirror_expr ( arm. body ) ,
839
839
lint_level : LintLevel :: Explicit ( arm. hir_id ) ,
840
- scope : region:: Scope { id : arm. hir_id . local_id , data : region:: ScopeData :: Node } ,
840
+ scope : region:: Scope { id : arm. hir_id . local_id , data : region:: ScopeData :: Node , for_stmt : false } ,
841
841
span : arm. span ,
842
842
} ;
843
843
self . thir . arms . push ( arm)
@@ -922,7 +922,7 @@ impl<'tcx> Cx<'tcx> {
922
922
// a constant reference (or constant raw pointer for `static mut`) in MIR
923
923
Res :: Def ( DefKind :: Static , id) => {
924
924
let ty = self . tcx . static_ptr_ty ( id) ;
925
- let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id ) ;
925
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id , false ) ;
926
926
let kind = if self . tcx . is_thread_local_static ( id) {
927
927
ExprKind :: ThreadLocalRef ( id)
928
928
} else {
@@ -1006,7 +1006,7 @@ impl<'tcx> Cx<'tcx> {
1006
1006
1007
1007
// construct the complete expression `foo()` for the overloaded call,
1008
1008
// which will yield the &T type
1009
- let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id ) ;
1009
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( expr. hir_id . local_id , false ) ;
1010
1010
let fun = self . method_callee ( expr, span, overloaded_callee) ;
1011
1011
let fun = self . thir . exprs . push ( fun) ;
1012
1012
let fun_ty = self . thir [ fun] . ty ;
@@ -1026,7 +1026,7 @@ impl<'tcx> Cx<'tcx> {
1026
1026
closure_expr : & ' tcx hir:: Expr < ' tcx > ,
1027
1027
place : HirPlace < ' tcx > ,
1028
1028
) -> Expr < ' tcx > {
1029
- let temp_lifetime = self . region_scope_tree . temporary_scope ( closure_expr. hir_id . local_id ) ;
1029
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( closure_expr. hir_id . local_id , false ) ;
1030
1030
let var_ty = place. base_ty ;
1031
1031
1032
1032
// The result of capture analysis in `rustc_typeck/check/upvar.rs`represents a captured path
@@ -1081,7 +1081,7 @@ impl<'tcx> Cx<'tcx> {
1081
1081
let upvar_capture = captured_place. info . capture_kind ;
1082
1082
let captured_place_expr =
1083
1083
self . convert_captured_hir_place ( closure_expr, captured_place. place . clone ( ) ) ;
1084
- let temp_lifetime = self . region_scope_tree . temporary_scope ( closure_expr. hir_id . local_id ) ;
1084
+ let temp_lifetime = self . region_scope_tree . temporary_scope ( closure_expr. hir_id . local_id , false ) ;
1085
1085
1086
1086
match upvar_capture {
1087
1087
ty:: UpvarCapture :: ByValue ( _) => captured_place_expr,
0 commit comments