11use rustc_middle:: ty:: RegionVid ;
22use rustc_mir_dataflow:: points:: PointIndex ;
33
4+ use crate :: region_infer:: values:: LivenessValues ;
5+
46/// A localized outlives constraint reifies the CFG location where the outlives constraint holds,
57/// within the origins themselves as if they were different from point to point: from `a: b`
68/// outlives constraints to `a@p: b@p`, where `p` is the point in the CFG.
@@ -23,6 +25,25 @@ pub(crate) struct LocalizedOutlivesConstraint {
2325 pub from : PointIndex ,
2426 pub target : RegionVid ,
2527 pub to : PointIndex ,
28+ pub tag : & ' static str ,
29+ }
30+
31+ impl rustc_mir_dataflow:: fmt:: DebugWithContext < LivenessValues > for LocalizedOutlivesConstraint {
32+ fn fmt_with (
33+ & self ,
34+ liveness : & LivenessValues ,
35+ fmt : & mut std:: fmt:: Formatter < ' _ > ,
36+ ) -> std:: fmt:: Result {
37+ write ! (
38+ fmt,
39+ "{}@{:?} -> {}@{:?} ({})" ,
40+ self . source. as_u32( ) ,
41+ liveness. location_from_point( self . from) ,
42+ self . target. as_u32( ) ,
43+ liveness. location_from_point( self . to) ,
44+ self . tag,
45+ )
46+ }
2647}
2748
2849/// A container of [LocalizedOutlivesConstraint]s that can be turned into a traversable
@@ -33,11 +54,11 @@ pub(crate) struct LocalizedOutlivesConstraintSet {
3354}
3455
3556impl LocalizedOutlivesConstraintSet {
36- pub ( crate ) fn push ( & mut self , constraint : LocalizedOutlivesConstraint ) {
37- if constraint. source == constraint. target && constraint. from == constraint. to {
38- // 'a@p: 'a@p is pretty uninteresting
39- return ;
40- }
41- self . outlives . push ( constraint) ;
42- }
57+ // pub(crate) fn push(&mut self, constraint: LocalizedOutlivesConstraint) {
58+ // if constraint.source == constraint.target && constraint.from == constraint.to {
59+ // // 'a@p: 'a@p is pretty uninteresting
60+ // return;
61+ // }
62+ // self.outlives.push(constraint);
63+ // }
4364}
0 commit comments