Skip to content

Commit 4bdda35

Browse files
committed
auto merge of #11252 : eddyb/rust/ty-cleanup, r=pcwalton
2 parents 99df8a3 + 08ac616 commit 4bdda35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+769
-912
lines changed

src/librustc/back/abi.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ pub static tydesc_field_size: uint = 0u;
4444
pub static tydesc_field_align: uint = 1u;
4545
pub static tydesc_field_take_glue: uint = 2u;
4646
pub static tydesc_field_drop_glue: uint = 3u;
47-
pub static tydesc_field_free_glue: uint = 4u;
48-
pub static tydesc_field_visit_glue: uint = 5u;
49-
pub static tydesc_field_borrow_offset: uint = 6u;
50-
pub static tydesc_field_name_offset: uint = 7u;
51-
pub static n_tydesc_fields: uint = 8u;
47+
pub static tydesc_field_visit_glue: uint = 4u;
48+
pub static tydesc_field_borrow_offset: uint = 5u;
49+
pub static tydesc_field_name_offset: uint = 6u;
50+
pub static n_tydesc_fields: uint = 7u;
5251

5352
// The two halves of a closure: code and environment.
5453
pub static fn_field_code: uint = 0u;

src/librustc/metadata/tydecode.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,11 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
354354
'V' => {
355355
let mt = parse_mt(st, |x,y| conv(x,y));
356356
let v = parse_vstore(st, |x,y| conv(x,y));
357-
return ty::mk_evec(st.tcx, mt, v);
357+
return ty::mk_vec(st.tcx, mt, v);
358358
}
359359
'v' => {
360360
let v = parse_vstore(st, |x,y| conv(x,y));
361-
return ty::mk_estr(st.tcx, v);
361+
return ty::mk_str(st.tcx, v);
362362
}
363363
'T' => {
364364
assert_eq!(next(st), '[');
@@ -410,7 +410,6 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
410410
let inner = parse_ty(st, |x,y| conv(x,y));
411411
inner
412412
}
413-
'B' => ty::mk_opaque_box(st.tcx),
414413
'a' => {
415414
assert_eq!(next(st), '[');
416415
let did = parse_def(st, NominalType, |x,y| conv(x,y));

src/librustc/metadata/tyencode.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) {
299299
enc_region(w, cx, r);
300300
enc_mt(w, cx, mt);
301301
}
302-
ty::ty_evec(mt, v) => {
302+
ty::ty_vec(mt, v) => {
303303
mywrite!(w, "V");
304304
enc_mt(w, cx, mt);
305305
enc_vstore(w, cx, v);
306306
}
307-
ty::ty_estr(v) => {
307+
ty::ty_str(v) => {
308308
mywrite!(w, "v");
309309
enc_vstore(w, cx, v);
310310
}
@@ -331,7 +331,6 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) {
331331
mywrite!(w, "C&");
332332
enc_sigil(w, p);
333333
}
334-
ty::ty_opaque_box => mywrite!(w, "B"),
335334
ty::ty_struct(def, ref substs) => {
336335
mywrite!(w, "a[{}|", (cx.ds)(def));
337336
enc_substs(w, cx, substs);

src/librustc/middle/astencode.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,6 @@ fn encode_method_map_entry(ecx: &e::EncodeContext,
578578
ebml_w.emit_struct_field("origin", 1u, |ebml_w| {
579579
mme.origin.encode(ebml_w);
580580
});
581-
ebml_w.emit_struct_field("self_mode", 3, |ebml_w| {
582-
mme.self_mode.encode(ebml_w);
583-
});
584581
})
585582
}
586583

@@ -602,11 +599,7 @@ impl<'a> read_method_map_entry_helper for reader::Decoder<'a> {
602599
let method_origin: method_origin =
603600
Decodable::decode(this);
604601
method_origin.tr(xcx)
605-
}),
606-
self_mode: this.read_struct_field("self_mode", 3, |this| {
607-
let self_mode: ty::SelfMode = Decodable::decode(this);
608-
self_mode
609-
}),
602+
})
610603
}
611604
})
612605
}

src/librustc/middle/borrowck/gather_loans/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ impl<'a> GatherLoanCtxt<'a> {
808808
*/
809809

810810
match ty::get(slice_ty).sty {
811-
ty::ty_evec(slice_mt, ty::vstore_slice(slice_r)) => {
811+
ty::ty_vec(slice_mt, ty::vstore_slice(slice_r)) => {
812812
(slice_mt.mutbl, slice_r)
813813
}
814814

src/librustc/middle/check_match.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) {
195195
}
196196
}
197197
}
198-
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
198+
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
199199
match *ctor {
200200
vec(n) => Some(format!("vectors of length {}", n).to_managed()),
201201
_ => None
@@ -274,10 +274,10 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
274274
}
275275
not_useful
276276
}
277-
ty::ty_evec(_, ty::vstore_fixed(n)) => {
277+
ty::ty_vec(_, ty::vstore_fixed(n)) => {
278278
is_useful_specialized(cx, m, v, vec(n), n, left_ty)
279279
}
280-
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
280+
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
281281
let max_len = m.rev_iter().fold(0, |max_len, r| {
282282
match r[0].node {
283283
PatVec(ref before, _, ref after) => {
@@ -437,7 +437,7 @@ fn missing_ctor(cx: &MatchCheckCtxt,
437437
else if true_found { Some(val(const_bool(false))) }
438438
else { Some(val(const_bool(true))) }
439439
}
440-
ty::ty_evec(_, ty::vstore_fixed(n)) => {
440+
ty::ty_vec(_, ty::vstore_fixed(n)) => {
441441
let mut missing = true;
442442
let mut wrong = false;
443443
for r in m.iter() {
@@ -460,7 +460,7 @@ fn missing_ctor(cx: &MatchCheckCtxt,
460460
_ => None
461461
}
462462
}
463-
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
463+
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
464464

465465
// Find the lengths and slices of all vector patterns.
466466
let mut vec_pat_lens = m.iter().filter_map(|r| {
@@ -525,7 +525,7 @@ fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint {
525525
}
526526
}
527527
ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(),
528-
ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
528+
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
529529
match *ctor {
530530
vec(n) => n,
531531
_ => 0u

src/librustc/middle/effect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl EffectCheckVisitor {
7171
debug!("effect: checking index with base type {}",
7272
ppaux::ty_to_str(self.tcx, base_type));
7373
match ty::get(base_type).sty {
74-
ty::ty_estr(..) => {
74+
ty::ty_str(..) => {
7575
self.tcx.sess.span_err(e.span,
7676
"modification of string types is not allowed");
7777
}

src/librustc/middle/lint.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -819,13 +819,13 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) {
819819
let mut n_uniq = 0;
820820
ty::fold_ty(cx.tcx, ty, |t| {
821821
match ty::get(t).sty {
822-
ty::ty_box(_) | ty::ty_estr(ty::vstore_box) |
823-
ty::ty_evec(_, ty::vstore_box) |
822+
ty::ty_box(_) | ty::ty_str(ty::vstore_box) |
823+
ty::ty_vec(_, ty::vstore_box) |
824824
ty::ty_trait(_, _, ty::BoxTraitStore, _, _) => {
825825
n_box += 1;
826826
}
827-
ty::ty_uniq(_) | ty::ty_estr(ty::vstore_uniq) |
828-
ty::ty_evec(_, ty::vstore_uniq) |
827+
ty::ty_uniq(_) | ty::ty_str(ty::vstore_uniq) |
828+
ty::ty_vec(_, ty::vstore_uniq) |
829829
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) => {
830830
n_uniq += 1;
831831
}

src/librustc/middle/mem_categorization.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -157,31 +157,31 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
157157
match ty::get(t).sty {
158158
ty::ty_uniq(_) |
159159
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) |
160-
ty::ty_evec(_, ty::vstore_uniq) |
161-
ty::ty_estr(ty::vstore_uniq) |
160+
ty::ty_vec(_, ty::vstore_uniq) |
161+
ty::ty_str(ty::vstore_uniq) |
162162
ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => {
163163
Some(deref_ptr(uniq_ptr))
164164
}
165165

166166
ty::ty_rptr(r, mt) |
167-
ty::ty_evec(mt, ty::vstore_slice(r)) => {
167+
ty::ty_vec(mt, ty::vstore_slice(r)) => {
168168
Some(deref_ptr(region_ptr(mt.mutbl, r)))
169169
}
170170

171171
ty::ty_trait(_, _, ty::RegionTraitStore(r), m, _) => {
172172
Some(deref_ptr(region_ptr(m, r)))
173173
}
174174

175-
ty::ty_estr(ty::vstore_slice(r)) |
175+
ty::ty_str(ty::vstore_slice(r)) |
176176
ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil,
177177
region: r, ..}) => {
178178
Some(deref_ptr(region_ptr(ast::MutImmutable, r)))
179179
}
180180

181181
ty::ty_box(_) |
182-
ty::ty_evec(_, ty::vstore_box) |
182+
ty::ty_vec(_, ty::vstore_box) |
183183
ty::ty_trait(_, _, ty::BoxTraitStore, _, _) |
184-
ty::ty_estr(ty::vstore_box) => {
184+
ty::ty_str(ty::vstore_box) => {
185185
Some(deref_ptr(gc_ptr))
186186
}
187187

@@ -194,8 +194,8 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
194194
Some(deref_interior(InteriorField(PositionalField(0))))
195195
}
196196

197-
ty::ty_evec(_, ty::vstore_fixed(_)) |
198-
ty::ty_estr(ty::vstore_fixed(_)) => {
197+
ty::ty_vec(_, ty::vstore_fixed(_)) |
198+
ty::ty_str(ty::vstore_fixed(_)) => {
199199
Some(deref_interior(InteriorElement(element_kind(t))))
200200
}
201201

@@ -1247,8 +1247,8 @@ impl Repr for InteriorKind {
12471247

12481248
fn element_kind(t: ty::t) -> ElementKind {
12491249
match ty::get(t).sty {
1250-
ty::ty_evec(..) => VecElement,
1251-
ty::ty_estr(..) => StrElement,
1250+
ty::ty_vec(..) => VecElement,
1251+
ty::ty_str(..) => StrElement,
12521252
_ => OtherElement
12531253
}
12541254
}

0 commit comments

Comments
 (0)