@@ -3110,35 +3110,50 @@ fn ty_params_to_tys(tcx: ty::ctxt, tps: ~[ast::ty_param]) -> ~[t] {
3110
3110
3111
3111
/// Returns an equivalent type with all the typedefs and self regions removed.
3112
3112
fn normalize_ty( cx: ctxt, t: t) -> t {
3113
+ fn normalize_mt( cx: ctxt, mt: mt) -> mt {
3114
+ { ty: normalize_ty( cx, mt. ty) , mutbl: mt. mutbl }
3115
+ }
3116
+ fn normalize_vstore( vstore: vstore) -> vstore {
3117
+ match vstore {
3118
+ vstore_fixed( * ) | vstore_uniq | vstore_box => vstore,
3119
+ vstore_slice( _) => vstore_slice( re_static)
3120
+ }
3121
+ }
3122
+
3113
3123
alt cx. normalized_cache. find( t) {
3114
3124
some( t) { return t; }
3115
3125
none { }
3116
3126
}
3117
3127
3118
- let t = alt get( t) . struct {
3119
- ty_rptr( region, mt) {
3128
+ let t = match get( t) . struct {
3129
+ ty_evec( mt, vstore) =>
3130
+ // This type has a vstore. Get rid of it
3131
+ mk_evec( cx, normalize_mt( cx, mt) , normalize_vstore( vstore) ) ,
3132
+
3133
+ ty_rptr( region, mt) =>
3120
3134
// This type has a region. Get rid of it
3121
- mk_rptr( cx, re_static, mt)
3122
- }
3123
- ty_enum( did, r) {
3124
- alt r. self_r {
3125
- some( _) {
3126
- // This enum has a self region. Get rid of it
3127
- mk_enum( cx, did, { self_r: none, self_ty: none, tps: r. tps} )
3128
- }
3129
- none { t }
3130
- }
3131
- }
3132
- ty_class( did, r) {
3133
- alt r. self_r {
3134
- some( _) {
3135
+ mk_rptr( cx, re_static, normalize_mt ( cx , mt) ) ,
3136
+
3137
+ ty_enum( did, r) =>
3138
+ match r. self_r {
3139
+ some( _) =>
3140
+ // This enum has a self region. Get rid of it
3141
+ mk_enum( cx, did, { self_r: none, self_ty: none, tps: r. tps} ) ,
3142
+ none =>
3143
+ t
3144
+ } ,
3145
+
3146
+ ty_class( did, r) =>
3147
+ match r. self_r {
3148
+ some( _) =>
3135
3149
// Ditto.
3136
- mk_class( cx, did, { self_r: none, self_ty: none, tps: r. tps} )
3137
- }
3138
- none { t }
3139
- }
3140
- }
3141
- _ { t }
3150
+ mk_class( cx, did, { self_r: none, self_ty: none, tps: r. tps} ) ,
3151
+ none =>
3152
+ t
3153
+ } ,
3154
+
3155
+ _ =>
3156
+ t
3142
3157
} ;
3143
3158
3144
3159
// FIXME #2187: This also reduced int types to their compatible machine
0 commit comments