@@ -10,6 +10,7 @@ use rustc_hir_analysis::astconv::AstConv;
10
10
use rustc_infer:: infer:: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
11
11
use rustc_infer:: infer:: LateBoundRegionConversionTime ;
12
12
use rustc_infer:: infer:: { InferOk , InferResult } ;
13
+ use rustc_macros:: { TypeFoldable , TypeVisitable } ;
13
14
use rustc_middle:: ty:: subst:: InternalSubsts ;
14
15
use rustc_middle:: ty:: visit:: TypeVisitable ;
15
16
use rustc_middle:: ty:: { self , Ty } ;
@@ -22,7 +23,7 @@ use std::cmp;
22
23
use std:: iter;
23
24
24
25
/// What signature do we *expect* the closure to have from context?
25
- #[ derive( Debug ) ]
26
+ #[ derive( Debug , Clone , TypeFoldable , TypeVisitable ) ]
26
27
struct ExpectedSig < ' tcx > {
27
28
/// Span that gave us this expectation, if we know that.
28
29
cause_span : Option < Span > ,
@@ -241,9 +242,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
241
242
if expected_sig. is_none ( )
242
243
&& let ty:: PredicateKind :: Projection ( proj_predicate) = bound_predicate. skip_binder ( )
243
244
{
244
- expected_sig = self . deduce_sig_from_projection (
245
+ expected_sig = self . normalize_associated_types_in (
246
+ obligation. cause . span ,
247
+ self . deduce_sig_from_projection (
245
248
Some ( obligation. cause . span ) ,
246
- bound_predicate. rebind ( proj_predicate) ,
249
+ bound_predicate. rebind ( proj_predicate) ,
250
+ ) ,
247
251
) ;
248
252
}
249
253
0 commit comments