From 48b3d8aa829a5ac3ff317e18ff025ac75a7c9665 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Fri, 26 Aug 2022 04:42:53 +0000 Subject: [PATCH] Drive-by: same_type_modulo_infer should handle ReVar == ReVar --- compiler/rustc_infer/src/infer/error_reporting/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 59ea1f3f9de4..85b99d5518b6 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -2720,7 +2720,10 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> { a: ty::Region<'tcx>, b: ty::Region<'tcx>, ) -> RelateResult<'tcx, ty::Region<'tcx>> { - if (a.is_var() && b.is_free_or_static()) || (b.is_var() && a.is_free_or_static()) || a == b + if (a.is_var() && b.is_free_or_static()) + || (b.is_var() && a.is_free_or_static()) + || (a.is_var() && b.is_var()) + || a == b { Ok(a) } else {