@@ -12,7 +12,7 @@ use borrow_check::borrow_set::BorrowSet;
12
12
use borrow_check:: location:: LocationTable ;
13
13
use borrow_check:: nll:: ToRegionVid ;
14
14
use borrow_check:: nll:: facts:: AllFacts ;
15
- use borrow_check:: nll:: region_infer:: { Cause , RegionInferenceContext } ;
15
+ use borrow_check:: nll:: region_infer:: RegionInferenceContext ;
16
16
use borrow_check:: nll:: type_check:: AtLocation ;
17
17
use rustc:: hir;
18
18
use rustc:: infer:: InferCtxt ;
@@ -33,7 +33,7 @@ pub(super) fn generate_constraints<'cx, 'gcx, 'tcx>(
33
33
location_table : & LocationTable ,
34
34
mir : & Mir < ' tcx > ,
35
35
borrow_set : & BorrowSet < ' tcx > ,
36
- liveness_set_from_typeck : & [ ( ty:: Region < ' tcx > , Location , Cause ) ] ,
36
+ liveness_set_from_typeck : & [ ( ty:: Region < ' tcx > , Location ) ] ,
37
37
) {
38
38
let mut cg = ConstraintGeneration {
39
39
borrow_set,
@@ -69,14 +69,14 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
69
69
/// We sometimes have `substs` within an rvalue, or within a
70
70
/// call. Make them live at the location where they appear.
71
71
fn visit_substs ( & mut self , substs : & & ' tcx Substs < ' tcx > , location : Location ) {
72
- self . add_regular_live_constraint ( * substs, location, Cause :: LiveOther ( location ) ) ;
72
+ self . add_regular_live_constraint ( * substs, location) ;
73
73
self . super_substs ( substs) ;
74
74
}
75
75
76
76
/// We sometimes have `region` within an rvalue, or within a
77
77
/// call. Make them live at the location where they appear.
78
78
fn visit_region ( & mut self , region : & ty:: Region < ' tcx > , location : Location ) {
79
- self . add_regular_live_constraint ( * region, location, Cause :: LiveOther ( location ) ) ;
79
+ self . add_regular_live_constraint ( * region, location) ;
80
80
self . super_region ( region) ;
81
81
}
82
82
@@ -94,7 +94,7 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
94
94
) ;
95
95
}
96
96
TyContext :: Location ( location) => {
97
- self . add_regular_live_constraint ( * ty, location, Cause :: LiveOther ( location ) ) ;
97
+ self . add_regular_live_constraint ( * ty, location) ;
98
98
}
99
99
}
100
100
@@ -104,14 +104,14 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
104
104
/// We sometimes have `generator_substs` within an rvalue, or within a
105
105
/// call. Make them live at the location where they appear.
106
106
fn visit_generator_substs ( & mut self , substs : & GeneratorSubsts < ' tcx > , location : Location ) {
107
- self . add_regular_live_constraint ( * substs, location, Cause :: LiveOther ( location ) ) ;
107
+ self . add_regular_live_constraint ( * substs, location) ;
108
108
self . super_generator_substs ( substs) ;
109
109
}
110
110
111
111
/// We sometimes have `closure_substs` within an rvalue, or within a
112
112
/// call. Make them live at the location where they appear.
113
113
fn visit_closure_substs ( & mut self , substs : & ClosureSubsts < ' tcx > , location : Location ) {
114
- self . add_regular_live_constraint ( * substs, location, Cause :: LiveOther ( location ) ) ;
114
+ self . add_regular_live_constraint ( * substs, location) ;
115
115
self . super_closure_substs ( substs) ;
116
116
}
117
117
@@ -233,7 +233,7 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
233
233
/// that we also have to respect.
234
234
fn add_region_liveness_constraints_from_type_check (
235
235
& mut self ,
236
- liveness_set : & [ ( ty:: Region < ' tcx > , Location , Cause ) ] ,
236
+ liveness_set : & [ ( ty:: Region < ' tcx > , Location ) ] ,
237
237
) {
238
238
debug ! (
239
239
"add_region_liveness_constraints_from_type_check(liveness_set={} items)" ,
@@ -247,16 +247,16 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
247
247
..
248
248
} = self ;
249
249
250
- for ( region, location, cause ) in liveness_set {
250
+ for ( region, location) in liveness_set {
251
251
debug ! ( "generate: {:#?} is live at {:#?}" , region, location) ;
252
252
let region_vid = regioncx. to_region_vid ( region) ;
253
- regioncx. add_live_point ( region_vid, * location, & cause ) ;
253
+ regioncx. add_live_point ( region_vid, * location) ;
254
254
}
255
255
256
256
if let Some ( all_facts) = all_facts {
257
257
all_facts
258
258
. region_live_at
259
- . extend ( liveness_set. into_iter ( ) . flat_map ( |( region, location, _ ) | {
259
+ . extend ( liveness_set. into_iter ( ) . flat_map ( |( region, location) | {
260
260
let r = regioncx. to_region_vid ( region) ;
261
261
let p1 = location_table. start_index ( * location) ;
262
262
let p2 = location_table. mid_index ( * location) ;
@@ -269,7 +269,7 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
269
269
/// `location` -- i.e., it may be used later. This means that all
270
270
/// regions appearing in the type `live_ty` must be live at
271
271
/// `location`.
272
- fn add_regular_live_constraint < T > ( & mut self , live_ty : T , location : Location , cause : Cause )
272
+ fn add_regular_live_constraint < T > ( & mut self , live_ty : T , location : Location )
273
273
where
274
274
T : TypeFoldable < ' tcx > ,
275
275
{
@@ -282,7 +282,7 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
282
282
. tcx
283
283
. for_each_free_region ( & live_ty, |live_region| {
284
284
let vid = live_region. to_region_vid ( ) ;
285
- self . regioncx . add_live_point ( vid, location, & cause ) ;
285
+ self . regioncx . add_live_point ( vid, location) ;
286
286
} ) ;
287
287
}
288
288
0 commit comments