@@ -63,24 +63,26 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
63
63
assert ! ( real_substs. tps. iter( ) . all( |t| !ty:: type_needs_infer( * t) ) ) ;
64
64
let _icx = push_ctxt ( "monomorphic_fn" ) ;
65
65
let mut must_cast = false ;
66
- let substs = real_substs. tps . iter ( ) . transform ( |t| {
66
+
67
+ let do_normalize = |t : & ty:: t | {
67
68
match normalize_for_monomorphization ( ccx. tcx , * t) {
68
69
Some ( t) => { must_cast = true ; t }
69
70
None => * t
70
71
}
71
- } ) . collect :: < ~[ ty:: t ] > ( ) ;
72
-
73
- for real_substs. tps. iter( ) . advance |s| { assert ! ( !ty:: type_has_params( * s) ) ; }
74
- for substs. iter( ) . advance |s| { assert ! ( !ty:: type_has_params( * s) ) ; }
75
- let param_uses = type_use:: type_uses_for( ccx, fn_id, substs. len( ) ) ;
72
+ } ;
76
73
77
74
let psubsts = @param_substs {
78
- tys : substs ,
75
+ tys : real_substs . tps . map ( |x| do_normalize ( x ) ) ,
79
76
vtables : vtables,
80
- self_ty : real_substs. self_ty,
77
+ self_ty : real_substs. self_ty . map ( |x| do_normalize ( x ) ) ,
81
78
self_vtable : self_vtable
82
79
} ;
83
80
81
+ for real_substs. tps. iter( ) . advance |s| { assert ! ( !ty:: type_has_params( * s) ) ; }
82
+ for psubsts. tys. iter( ) . advance |s| { assert ! ( !ty:: type_has_params( * s) ) ; }
83
+ let param_uses = type_use:: type_uses_for( ccx, fn_id, psubsts. tys. len( ) ) ;
84
+
85
+
84
86
let hash_id = make_mono_id( ccx, fn_id, impl_did_opt,
85
87
& * psubsts,
86
88
Some ( param_uses) ) ;
0 commit comments