about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2021-12-15 23:25:03 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2022-03-27 02:20:17 +0000
commitb09420f95a719c85e60b501955d356b1c34abf16 (patch)
tree4ae9287485b81021871d65153578db9d38666877
parent1c85987274d46cd08d74decec0ee1c754597d271 (diff)
downloadrust-b09420f95a719c85e60b501955d356b1c34abf16.tar.gz
rust-b09420f95a719c85e60b501955d356b1c34abf16.zip
Drive by: handle references in `same_type_modulo_infer`
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
index f1c21f59239..78b21a235cb 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
@@ -333,6 +333,9 @@ pub fn same_type_modulo_infer<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
         )
         | (&ty::Infer(ty::InferTy::TyVar(_)), _)
         | (_, &ty::Infer(ty::InferTy::TyVar(_))) => true,
+        (&ty::Ref(reg_a, ty_a, mut_a), &ty::Ref(reg_b, ty_b, mut_b)) => {
+            reg_a == reg_b && mut_a == mut_b && same_type_modulo_infer(ty_a, ty_b)
+        }
         _ => a == b,
     }
 }