File tree 1 file changed +1
-4
lines changed
compiler/rustc_trait_selection/src/traits
1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change 70
70
// Before doing expensive operations like entering an inference context, do
71
71
// a quick check via fast_reject to tell if the impl headers could possibly
72
72
// unify.
73
- let impl1_self = tcx. type_of ( impl1_def_id) ;
74
- let impl2_self = tcx. type_of ( impl2_def_id) ;
75
73
let impl1_ref = tcx. impl_trait_ref ( impl1_def_id) ;
76
74
let impl2_ref = tcx. impl_trait_ref ( impl2_def_id) ;
77
75
@@ -80,14 +78,13 @@ where
80
78
. iter ( )
81
79
. flat_map ( |tref| tref. substs . types ( ) )
82
80
. zip ( impl2_ref. iter ( ) . flat_map ( |tref| tref. substs . types ( ) ) )
83
- . chain ( iter:: once ( ( impl1_self, impl2_self) ) )
84
81
. any ( |( ty1, ty2) | {
85
82
let t1 = fast_reject:: simplify_type ( tcx, ty1, false ) ;
86
83
let t2 = fast_reject:: simplify_type ( tcx, ty2, false ) ;
87
84
if let ( Some ( t1) , Some ( t2) ) = ( t1, t2) {
88
85
// Simplified successfully
89
86
// Types cannot unify if they differ in their reference mutability or simplify to different types
90
- t1 != t2 || ty1. ref_mutability ( ) != ty2. ref_mutability ( )
87
+ t1 != t2 || ty1. ref_mutability ( ) != ty2. ref_mutability ( )
91
88
} else {
92
89
// Types might unify
93
90
false
You can’t perform that action at this time.
0 commit comments