File tree 2 files changed +28
-1
lines changed
compiler/rustc_infer/src/infer/outlives
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,10 @@ impl<'tcx> OutlivesEnvironmentBuilder<'tcx> {
142
142
ty:: ReStatic | ty:: ReEarlyBound ( _) | ty:: ReFree ( _) ,
143
143
) => self . region_relation . add ( r_a, r_b) ,
144
144
( ty:: ReError ( _) , _) | ( _, ty:: ReError ( _) ) => { }
145
- _ => bug ! ( "add_outlives_bounds: unexpected regions" ) ,
145
+ // FIXME(#109628): We shouldn't have existential variables in implied bounds.
146
+ // Panic here once the linked issue is resolved!
147
+ ( ty:: ReVar ( _) , _) | ( _, ty:: ReVar ( _) ) => { }
148
+ _ => bug ! ( "add_outlives_bounds: unexpected regions: ({r_a:?}, {r_b:?})" ) ,
146
149
} ,
147
150
}
148
151
}
Original file line number Diff line number Diff line change
1
+ // Because of #109628, we can have unbounded region vars in implied bounds.
2
+ // Make sure we don't ICE in this case!
3
+ //
4
+ // check-pass
5
+
6
+ pub trait MapAccess {
7
+ type Error ;
8
+ fn next_key_seed ( & mut self ) -> Option < Self :: Error > ;
9
+ }
10
+
11
+ struct Access < ' a > {
12
+ _marker : std:: marker:: PhantomData < & ' a ( ) > ,
13
+ }
14
+
15
+ // implied_bounds(Option<Self::Error>) = ['?1: 'a, ]
16
+ // where '?1 is a fresh region var.
17
+ impl < ' a , ' b : ' a > MapAccess for Access < ' a > {
18
+ type Error = ( ) ;
19
+ fn next_key_seed ( & mut self ) -> Option < Self :: Error > {
20
+ unimplemented ! ( )
21
+ }
22
+ }
23
+
24
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments