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,
                     });
diff --git a/tests/ui/type-alias-impl-trait/param_mismatch4.rs b/tests/ui/type-alias-impl-trait/param_mismatch4.rs
new file mode 100644
index 00000000000..e072f3ab8e0
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/param_mismatch4.rs
@@ -0,0 +1,16 @@
+//! This test checks that when checking for opaque types that
+//! only differ in lifetimes, we handle the case of non-generic
+//! regions correctly.
+#![feature(type_alias_impl_trait)]
+
+type Opq<'a> = impl Sized;
+
+// Two defining uses: Opq<'{empty}> and Opq<'a>.
+// This used to ICE.
+// issue: #122782
+fn build<'a>() -> Opq<'a> {
+    let _: Opq<'_> = ();
+    //~^ ERROR expected generic lifetime parameter, found `'_`
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/param_mismatch4.stderr b/tests/ui/type-alias-impl-trait/param_mismatch4.stderr
new file mode 100644
index 00000000000..d3fdea25a3d
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/param_mismatch4.stderr
@@ -0,0 +1,12 @@
+error[E0792]: expected generic lifetime parameter, found `'_`
+  --> $DIR/param_mismatch4.rs:12:12
+   |
+LL | type Opq<'a> = impl Sized;
+   |          -- this generic parameter must be used with a generic lifetime parameter
+...
+LL |     let _: Opq<'_> = ();
+   |            ^^^^^^^
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0792`.