about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2024-03-21 03:04:49 +0000
committerAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2024-03-26 09:26:23 +0000
commit92f40b8059096c8cc868c1116a31a6d2eea8bc71 (patch)
tree99e00840d8ddcb4236acde76b148295ab7985ce7 /compiler/rustc_borrowck/src
parent73476d49904751f8d90ce904e16dfbc278083d2c (diff)
downloadrust-92f40b8059096c8cc868c1116a31a6d2eea8bc71.tar.gz
rust-92f40b8059096c8cc868c1116a31a6d2eea8bc71.zip
fix ICE in check_unique
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/region_infer/opaque_types.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
index d5875a226fe..49f7242cd83 100644
--- a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
+++ b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
@@ -69,9 +69,18 @@ impl<'tcx> RegionInferenceContext<'tcx> {
                         continue;
                     }
 
+                    // Ignore non-universal regions because they result in an error eventually.
+                    // FIXME(aliemjay): This logic will be rewritten in a later commit.
+                    let Some(r1) = self.universal_name(r1) else {
+                        continue;
+                    };
+                    let Some(r2) = self.universal_name(r2) else {
+                        continue;
+                    };
+
                     infcx.dcx().emit_err(LifetimeMismatchOpaqueParam {
-                        arg: self.universal_name(r1).unwrap().into(),
-                        prev: self.universal_name(r2).unwrap().into(),
+                        arg: r1.into(),
+                        prev: r2.into(),
                         span: a_ty.span,
                         prev_span: b_ty.span,
                     });