@@ -152,8 +152,8 @@ impl<'tcx> OutlivesConstraintSet<'tcx> {
152
152
if let Some ( to) = annotation. universe_violation ( ) {
153
153
outlives_static. insert ( scc) ;
154
154
self . add_placeholder_violation_constraint (
155
- annotation. representative ,
156
- annotation. representative ,
155
+ annotation. representative_rvid ( ) ,
156
+ annotation. representative_rvid ( ) ,
157
157
to,
158
158
fr_static,
159
159
) ;
@@ -179,35 +179,22 @@ impl<'tcx> OutlivesConstraintSet<'tcx> {
179
179
let annotation = sccs. annotation ( scc) ;
180
180
181
181
if sccs. scc ( fr_static) == scc || outlives_static. contains ( & scc) {
182
- debug ! ( "{:?} already outlives (or is) static" , annotation. representative ) ;
182
+ debug ! ( "{:?} already outlives (or is) static" , annotation. representative_rvid ( ) ) ;
183
183
continue ;
184
184
}
185
185
186
- // Unwrap safety: since this is our SCC it must contain us, which is
187
- // at worst min AND max, but it has at least one or there is a bug.
188
- let min = annotation. min_reachable_placeholder . unwrap ( ) ;
189
- let max = annotation. max_reachable_placeholder . unwrap ( ) ;
190
-
191
- // Good path: Nothing to see here, at least no other placeholders!
192
- if min == max {
193
- continue ;
194
- }
195
-
196
- // Bad path: figure out who we illegally reached.
197
- // Note that this will prefer the representative if it is a
198
- // placeholder, since the representative has the smallest index!
199
- let other_placeholder = if min != rvid { min } else { max } ;
200
-
201
- debug ! (
202
- "Placeholder {rvid:?} of SCC {scc:?} reaches other placeholder {other_placeholder:?}"
203
- ) ;
204
- outlives_static. insert ( scc) ;
205
- self . add_placeholder_violation_constraint (
206
- annotation. representative ,
207
- rvid,
208
- other_placeholder,
209
- fr_static,
210
- ) ;
186
+ if let Some ( other_placeholder) = annotation. reaches_other_placeholder ( rvid) {
187
+ debug ! (
188
+ "Placeholder {rvid:?} of SCC {scc:?} reaches other placeholder {other_placeholder:?}"
189
+ ) ;
190
+ outlives_static. insert ( scc) ;
191
+ self . add_placeholder_violation_constraint (
192
+ annotation. representative_rvid ( ) ,
193
+ rvid,
194
+ other_placeholder,
195
+ fr_static,
196
+ ) ;
197
+ } ;
211
198
}
212
199
213
200
if !outlives_static. is_empty ( ) {
0 commit comments