Skip to content

Commit 6f055f7

Browse files
committed
---
yaml --- r: 22552 b: refs/heads/master c: 7b2f475 h: refs/heads/master v: v3
1 parent bdd3bc8 commit 6f055f7

File tree

10 files changed

+27
-49
lines changed

10 files changed

+27
-49
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d884085f43f87213e3045e474c39908d6555153a
2+
refs/heads/master: 7b2f4755f3de2af6a8038ca960801853b86eb7ad
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ enum ty_ {
503503
ty_tup(~[@ty]),
504504
ty_path(@path, node_id),
505505
ty_constr(@ty, ~[@ty_constr]),
506-
ty_vstore(@ty, vstore),
506+
ty_fixed_length(@ty, option<uint>),
507507
ty_mac(mac),
508508
// ty_infer means the type should be inferred instead of it having been
509509
// specified. This should only appear at the "top level" of a type and not

trunk/src/libsyntax/ext/auto_serialize.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,9 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
497497
}]
498498
}
499499

500-
// For unique vstores, just pass through to the underlying vec or str
501-
ast::ty_vstore(ty, ast::vstore_uniq) {
502-
ser_ty(cx, tps, ty, s, v)
503-
}
504-
505-
ast::ty_vstore(_, _) {
506-
cx.span_unimpl(ty.span, ~"serialization for vstore types");
500+
ast::ty_fixed_length(_, _) {
501+
cx.span_unimpl(ty.span, ~"serialization for fixed length types");
507502
}
508-
509503
}
510504
}
511505

@@ -720,13 +714,8 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map,
720714
#ast{ std::serialization::read_to_vec($(d), $(l)) }
721715
}
722716

723-
// For unique vstores, just pass through to the underlying vec or str
724-
ast::ty_vstore(ty, ast::vstore_uniq) {
725-
deser_ty(cx, tps, ty, d)
726-
}
727-
728-
ast::ty_vstore(_, _) {
729-
cx.span_unimpl(ty.span, ~"deserialization for vstore types");
717+
ast::ty_fixed_length(_, _) {
718+
cx.span_unimpl(ty.span, ~"deserialization for fixed length types");
730719
}
731720
}
732721
}

trunk/src/libsyntax/fold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ fn noop_fold_ty(t: ty_, fld: ast_fold) -> ty_ {
506506
ty_path(path, id) {ty_path(fld.fold_path(path), fld.new_id(id))}
507507
ty_constr(ty, constrs) {ty_constr(fld.fold_ty(ty),
508508
vec::map(constrs, |x| fld.fold_ty_constr(x)))}
509-
ty_vstore(t, vs) {ty_vstore(fld.fold_ty(t), vs)}
509+
ty_fixed_length(t, vs) {ty_fixed_length(fld.fold_ty(t), vs)}
510510
ty_mac(mac) {ty_mac(fold_mac(mac))}
511511
}
512512
}

trunk/src/libsyntax/parse/parser.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
4949
tt_delim, tt_dotdotdot, tt_flat, tt_interpolate, ty, ty_, ty_bot,
5050
ty_box, ty_constr, ty_constr_, ty_constr_arg, ty_field, ty_fn,
5151
ty_infer, ty_mac, ty_method, ty_nil, ty_param, ty_path, ty_ptr,
52-
ty_rec, ty_rptr, ty_tup, ty_u32, ty_uniq, ty_vec, ty_vstore,
52+
ty_rec, ty_rptr, ty_tup, ty_u32, ty_uniq, ty_vec,
53+
ty_fixed_length,
5354
unchecked_blk, uniq, unsafe_blk, unsafe_fn, variant, view_item,
5455
view_item_, view_item_export, view_item_import, view_item_use,
5556
view_path, view_path_glob, view_path_list, view_path_simple,
@@ -554,11 +555,11 @@ class parser {
554555
555556
let sp = mk_sp(lo, self.last_span.hi);
556557
ret @{id: self.get_id(),
557-
node: alt self.maybe_parse_vstore() {
558-
// Consider a vstore suffix like /@ or /~
558+
node: alt self.maybe_parse_fixed_vstore() {
559+
// Consider a fixed vstore suffix (/N or /_)
559560
none { t }
560561
some(v) {
561-
ty_vstore(@{id: self.get_id(), node:t, span: sp}, v)
562+
ty_fixed_length(@{id: self.get_id(), node:t, span: sp}, v)
562563
} },
563564
span: sp}
564565
}
@@ -650,15 +651,15 @@ class parser {
650651
}
651652
}
652653
653-
fn maybe_parse_vstore() -> option<vstore> {
654+
fn maybe_parse_fixed_vstore() -> option<option<uint>> {
654655
if self.token == token::BINOP(token::SLASH) {
655656
self.bump();
656657
alt copy self.token {
657658
token::UNDERSCORE {
658-
self.bump(); some(vstore_fixed(none))
659+
self.bump(); some(none)
659660
}
660661
token::LIT_INT_UNSUFFIXED(i) if i >= 0i64 {
661-
self.bump(); some(vstore_fixed(some(i as uint)))
662+
self.bump(); some(some(i as uint))
662663
}
663664
_ {
664665
none
@@ -1029,11 +1030,11 @@ class parser {
10291030
alt ex {
10301031
expr_lit(@{node: lit_str(_), span: _}) |
10311032
expr_vec(_, _) {
1032-
alt self.maybe_parse_vstore() {
1033+
alt self.maybe_parse_fixed_vstore() {
10331034
none { }
10341035
some(v) {
10351036
hi = self.span.hi;
1036-
ex = expr_vstore(self.mk_expr(lo, hi, ex), v);
1037+
ex = expr_vstore(self.mk_expr(lo, hi, ex), vstore_fixed(v));
10371038
}
10381039
}
10391040
}

trunk/src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,10 @@ fn print_type_ex(s: ps, &&ty: @ast::ty, print_colons: bool) {
378378
space(s.s);
379379
word(s.s, constrs_str(cs, ty_constr_to_str));
380380
}
381-
ast::ty_vstore(t, v) {
382-
alt v {
383-
ast::vstore_fixed(_) {
384-
print_type(s, t);
385-
word(s.s, ~"/");
386-
print_vstore(s, v);
387-
}
388-
_ {
389-
print_vstore(s, v);
390-
print_type(s, t);
391-
}
392-
}
381+
ast::ty_fixed_length(t, v) {
382+
print_type(s, t);
383+
word(s.s, ~"/");
384+
print_vstore(s, ast::vstore_fixed(v));
393385
}
394386
ast::ty_mac(_) {
395387
fail ~"print_type doesn't know how to print a ty_mac";

trunk/src/libsyntax/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
200200
v.visit_ty(decl.output, e, v);
201201
}
202202
ty_path(p, _) { visit_path(p, e, v); }
203-
ty_vstore(t, _) {
203+
ty_fixed_length(t, _) {
204204
v.visit_ty(t, e, v);
205205
}
206206
ty_constr(t, cs) {

trunk/src/rustc/middle/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ fn check_item_old_vecs(cx: ty::ctxt, it: @ast::item) {
464464
old_strs, t.id, it.id,
465465
t.span, ~"deprecated str type");
466466
}
467-
ast::ty_vstore(inner, _) |
467+
ast::ty_fixed_length(inner, _) |
468468
ast::ty_box({ty: inner, _}) |
469469
ast::ty_uniq({ty: inner, _}) |
470470
ast::ty_rptr(_, {ty: inner, _}) {

trunk/src/rustc/middle/region.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,7 @@ fn determine_rp_in_ty(ty: @ast::ty,
566566
// like path/r, add to the worklist/set
567567
alt ty.node {
568568
ast::ty_rptr(r, _) |
569-
ast::ty_path(@{rp: some(r), _}, _) |
570-
ast::ty_vstore(_, ast::vstore_slice(r)) => {
569+
ast::ty_path(@{rp: some(r), _}, _) => {
571570
#debug["referenced type with regions %s", pprust::ty_to_str(ty)];
572571
if cx.region_is_relevant(r) {
573572
cx.add_rp(cx.item_id);
@@ -644,4 +643,4 @@ fn determine_rp_in_crate(sess: session,
644643

645644
// return final set
646645
ret cx.region_paramd_items;
647-
}
646+
}

trunk/src/rustc/middle/typeck/astconv.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy>(
316316
}
317317
}
318318
}
319-
ast::ty_vstore(a_t, ast::vstore_fixed(some(u))) {
319+
ast::ty_fixed_length(a_t, some(u)) {
320320
mk_maybe_vstore(self, rscope, {ty: a_t, mutbl: ast::m_imm},
321321
ty::vstore_fixed(u),
322322
|ty| {
@@ -327,14 +327,11 @@ fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy>(
327327
ty.ty
328328
})
329329
}
330-
ast::ty_vstore(_, ast::vstore_fixed(none)) {
330+
ast::ty_fixed_length(_, none) {
331331
tcx.sess.span_bug(
332332
ast_ty.span,
333333
~"implied fixed length for bound");
334334
}
335-
ast::ty_vstore(_, _) {
336-
tcx.sess.span_bug(ast_ty.span, ~"vstore in type??");
337-
}
338335
ast::ty_constr(t, cs) {
339336
let mut out_cs = ~[];
340337
for cs.each |constr| {

0 commit comments

Comments
 (0)