@@ -51,21 +51,21 @@ use std::rc::Rc;
51
51
use llvm:: { ValueRef , True , IntEQ , IntNE } ;
52
52
use back:: abi:: FAT_PTR_ADDR ;
53
53
use middle:: subst;
54
- use middle:: subst:: Subst ;
54
+ use middle:: ty:: { mod, Ty , UnboxedClosureTyper } ;
55
+ use middle:: ty:: Disr ;
56
+ use syntax:: ast;
57
+ use syntax:: attr;
58
+ use syntax:: attr:: IntType ;
55
59
use trans:: _match;
56
60
use trans:: build:: * ;
57
61
use trans:: cleanup;
58
62
use trans:: cleanup:: CleanupMethods ;
59
63
use trans:: common:: * ;
60
64
use trans:: datum;
61
65
use trans:: machine;
66
+ use trans:: monomorphize;
62
67
use trans:: type_:: Type ;
63
68
use trans:: type_of;
64
- use middle:: ty:: { self , Ty , UnboxedClosureTyper } ;
65
- use middle:: ty:: Disr ;
66
- use syntax:: ast;
67
- use syntax:: attr;
68
- use syntax:: attr:: IntType ;
69
69
use util:: ppaux:: ty_to_string;
70
70
71
71
type Hint = attr:: ReprAttr ;
@@ -159,7 +159,8 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
159
159
ty:: ty_struct( def_id, substs) => {
160
160
let fields = ty:: lookup_struct_fields ( cx. tcx ( ) , def_id) ;
161
161
let mut ftys = fields. iter ( ) . map ( |field| {
162
- ty:: lookup_field_type ( cx. tcx ( ) , def_id, field. id , substs)
162
+ let fty = ty:: lookup_field_type ( cx. tcx ( ) , def_id, field. id , substs) ;
163
+ monomorphize:: normalize_associated_type ( cx. tcx ( ) , & fty)
163
164
} ) . collect :: < Vec < _ > > ( ) ;
164
165
let packed = ty:: lookup_packed ( cx. tcx ( ) , def_id) ;
165
166
let dtor = ty:: ty_dtor ( cx. tcx ( ) , def_id) . has_drop_flag ( ) ;
@@ -432,7 +433,7 @@ fn get_cases<'tcx>(tcx: &ty::ctxt<'tcx>,
432
433
-> Vec < Case < ' tcx > > {
433
434
ty:: enum_variants ( tcx, def_id) . iter ( ) . map ( |vi| {
434
435
let arg_tys = vi. args . iter ( ) . map ( |& raw_ty| {
435
- raw_ty . subst ( tcx, substs)
436
+ monomorphize :: apply_param_substs ( tcx, substs, & raw_ty )
436
437
} ) . collect ( ) ;
437
438
Case { discr : vi. disr_val , tys : arg_tys }
438
439
} ) . collect ( )
0 commit comments