Skip to content

Commit 9abcf0b

Browse files
committed
---
yaml --- r: 31599 b: refs/heads/dist-snap c: 16a0f72 h: refs/heads/master i: 31597: d0d79d7 31595: 75e9c78 31591: de8671b 31583: 264aa4d v: v3
1 parent a80b57c commit 9abcf0b

File tree

2 files changed

+38
-23
lines changed

2 files changed

+38
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 51b9674ed7af96f31aa164215722710f8d3d9384
10+
refs/heads/dist-snap: 16a0f72f8ca85b1e2a1b69043dc16c6cf20cc83f
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/middle/ty.rs

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,35 +3110,50 @@ fn ty_params_to_tys(tcx: ty::ctxt, tps: ~[ast::ty_param]) -> ~[t] {
31103110

31113111
/// Returns an equivalent type with all the typedefs and self regions removed.
31123112
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+
31133123
alt cx.normalized_cache.find(t) {
31143124
some(t) { return t; }
31153125
none { }
31163126
}
31173127

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) =>
31203134
// 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(_) =>
31353149
// 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
31423157
};
31433158

31443159
// FIXME #2187: This also reduced int types to their compatible machine

0 commit comments

Comments
 (0)