File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
compiler/rustc_borrowck/src/region_infer Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2249,7 +2249,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2249
2249
}
2250
2250
2251
2251
pub ( crate ) fn universe_info ( & self , universe : ty:: UniverseIndex ) -> UniverseInfo < ' tcx > {
2252
- self . universe_causes [ & universe] . clone ( )
2252
+ // Query canonicalization can create local superuniverses (for example in
2253
+ // `InferCtx::query_response_substitution_guess`), but they don't have an associated
2254
+ // `UniverseInfo` explaining why they were created.
2255
+ // This can cause ICEs if these causes are accessed in diagnostics, for example in issue
2256
+ // #114907 where this happens via liveness and dropck outlives results.
2257
+ // Therefore, we return a default value in case that happens, which should at worst emit a
2258
+ // suboptimal error, instead of the ICE.
2259
+ self . universe_causes . get ( & universe) . cloned ( ) . unwrap_or_else ( || UniverseInfo :: other ( ) )
2253
2260
}
2254
2261
2255
2262
/// Tries to find the terminator of the loop in which the region 'r' resides.
You can’t perform that action at this time.
0 commit comments