From d25d79d630e1fe5ae8edfec1fbb403c4d8f0c64f Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 28 Jun 2022 16:09:54 +0000 Subject: [PATCH] skip binder before erasing. --- compiler/rustc_infer/src/infer/outlives/test_type_match.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_infer/src/infer/outlives/test_type_match.rs b/compiler/rustc_infer/src/infer/outlives/test_type_match.rs index 9f71ebae99e5b..ffddc0d100da3 100644 --- a/compiler/rustc_infer/src/infer/outlives/test_type_match.rs +++ b/compiler/rustc_infer/src/infer/outlives/test_type_match.rs @@ -79,8 +79,7 @@ pub(super) fn can_match_erased_ty<'tcx>( erased_ty: Ty<'tcx>, ) -> bool { assert!(!outlives_predicate.has_escaping_bound_vars()); - let erased_outlives_predicate = tcx.erase_regions(outlives_predicate); - let outlives_ty = erased_outlives_predicate.skip_binder().0; + let outlives_ty = tcx.erase_regions(outlives_predicate.skip_binder().0); if outlives_ty == erased_ty { // pointless micro-optimization true