@@ -12,7 +12,7 @@ use borrow_check::borrow_set::BorrowSet;
1212use borrow_check:: location:: LocationTable ;
1313use borrow_check:: nll:: ToRegionVid ;
1414use borrow_check:: nll:: facts:: AllFacts ;
15- use borrow_check:: nll:: region_infer:: { Cause , RegionInferenceContext } ;
15+ use borrow_check:: nll:: region_infer:: RegionInferenceContext ;
1616use borrow_check:: nll:: type_check:: AtLocation ;
1717use rustc:: hir;
1818use rustc:: infer:: InferCtxt ;
@@ -33,7 +33,7 @@ pub(super) fn generate_constraints<'cx, 'gcx, 'tcx>(
3333 location_table : & LocationTable ,
3434 mir : & Mir < ' tcx > ,
3535 borrow_set : & BorrowSet < ' tcx > ,
36- liveness_set_from_typeck : & [ ( ty:: Region < ' tcx > , Location , Cause ) ] ,
36+ liveness_set_from_typeck : & [ ( ty:: Region < ' tcx > , Location ) ] ,
3737) {
3838 let mut cg = ConstraintGeneration {
3939 borrow_set,
@@ -69,14 +69,14 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
6969 /// We sometimes have `substs` within an rvalue, or within a
7070 /// call. Make them live at the location where they appear.
7171 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) ;
7373 self . super_substs ( substs) ;
7474 }
7575
7676 /// We sometimes have `region` within an rvalue, or within a
7777 /// call. Make them live at the location where they appear.
7878 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) ;
8080 self . super_region ( region) ;
8181 }
8282
@@ -94,7 +94,7 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
9494 ) ;
9595 }
9696 TyContext :: Location ( location) => {
97- self . add_regular_live_constraint ( * ty, location, Cause :: LiveOther ( location ) ) ;
97+ self . add_regular_live_constraint ( * ty, location) ;
9898 }
9999 }
100100
@@ -104,14 +104,14 @@ impl<'cg, 'cx, 'gcx, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'cx, 'gcx
104104 /// We sometimes have `generator_substs` within an rvalue, or within a
105105 /// call. Make them live at the location where they appear.
106106 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) ;
108108 self . super_generator_substs ( substs) ;
109109 }
110110
111111 /// We sometimes have `closure_substs` within an rvalue, or within a
112112 /// call. Make them live at the location where they appear.
113113 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) ;
115115 self . super_closure_substs ( substs) ;
116116 }
117117
@@ -233,7 +233,7 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
233233 /// that we also have to respect.
234234 fn add_region_liveness_constraints_from_type_check (
235235 & mut self ,
236- liveness_set : & [ ( ty:: Region < ' tcx > , Location , Cause ) ] ,
236+ liveness_set : & [ ( ty:: Region < ' tcx > , Location ) ] ,
237237 ) {
238238 debug ! (
239239 "add_region_liveness_constraints_from_type_check(liveness_set={} items)" ,
@@ -247,16 +247,16 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
247247 ..
248248 } = self ;
249249
250- for ( region, location, cause ) in liveness_set {
250+ for ( region, location) in liveness_set {
251251 debug ! ( "generate: {:#?} is live at {:#?}" , region, location) ;
252252 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) ;
254254 }
255255
256256 if let Some ( all_facts) = all_facts {
257257 all_facts
258258 . region_live_at
259- . extend ( liveness_set. into_iter ( ) . flat_map ( |( region, location, _ ) | {
259+ . extend ( liveness_set. into_iter ( ) . flat_map ( |( region, location) | {
260260 let r = regioncx. to_region_vid ( region) ;
261261 let p1 = location_table. start_index ( * location) ;
262262 let p2 = location_table. mid_index ( * location) ;
@@ -269,7 +269,7 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
269269 /// `location` -- i.e., it may be used later. This means that all
270270 /// regions appearing in the type `live_ty` must be live at
271271 /// `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 )
273273 where
274274 T : TypeFoldable < ' tcx > ,
275275 {
@@ -282,7 +282,7 @@ impl<'cx, 'cg, 'gcx, 'tcx> ConstraintGeneration<'cx, 'cg, 'gcx, 'tcx> {
282282 . tcx
283283 . for_each_free_region ( & live_ty, |live_region| {
284284 let vid = live_region. to_region_vid ( ) ;
285- self . regioncx . add_live_point ( vid, location, & cause ) ;
285+ self . regioncx . add_live_point ( vid, location) ;
286286 } ) ;
287287 }
288288
0 commit comments