Skip to content

Commit c7f9a25

Browse files
committed
---
yaml --- r: 22522 b: refs/heads/master c: f5e69d6 h: refs/heads/master v: v3
1 parent 4198b53 commit c7f9a25

File tree

9 files changed

+28
-30
lines changed

9 files changed

+28
-30
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: 985b52be6df504ce6dcef29df61ea20ab9c9323f
2+
refs/heads/master: f5e69d611e83c392cb83837ed3e6e440cc180d63
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libsyntax/print/pprust.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,15 @@ fn print_type_ex(s: ps, &&ty: @ast::ty, print_colons: bool) {
379379
word(s.s, constrs_str(cs, ty_constr_to_str));
380380
}
381381
ast::ty_vstore(t, v) {
382-
// If it is a vector, print it in prefix notation.
383-
// Someday it will all be like this.
384-
let is_fixed = alt v { ast::vstore_fixed(_) { true } _ { false } };
385-
alt t.node {
386-
ast::ty_vec(*) if !is_fixed {
387-
print_vstore(s, v);
382+
alt v {
383+
ast::vstore_fixed(_) {
388384
print_type(s, t);
385+
word(s.s, "/");
386+
print_vstore(s, v);
389387
}
390388
_ {
391-
print_type(s, t);
392-
word(s.s, "/");
393389
print_vstore(s, v);
390+
print_type(s, t);
394391
}
395392
}
396393
}
@@ -888,18 +885,15 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
888885
s.ann.pre(ann_node);
889886
alt expr.node {
890887
ast::expr_vstore(e, v) {
891-
// If it is a vector, print it in prefix notation.
892-
// Someday it will all be like this.
893-
let is_fixed = alt v { ast::vstore_fixed(_) { true } _ { false } };
894-
alt e.node {
895-
ast::expr_vec(*) if !is_fixed {
896-
print_vstore(s, v);
888+
alt v {
889+
ast::vstore_fixed(_) {
897890
print_expr(s, e);
891+
word(s.s, "/");
892+
print_vstore(s, v);
898893
}
899894
_ {
900-
print_expr(s, e);
901-
word(s.s, "/");
902895
print_vstore(s, v);
896+
print_expr(s, e);
903897
}
904898
}
905899
}

trunk/src/rustc/util/ppaux.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ fn vstore_to_str(cx: ctxt, vs: ty::vstore) -> str {
100100
}
101101
}
102102

103+
fn vstore_ty_to_str(cx: ctxt, ty: str, vs: ty::vstore) -> str {
104+
alt vs {
105+
ty::vstore_fixed(_) {
106+
#fmt["%s/%s", ty, vstore_to_str(cx, vs)]
107+
}
108+
_ { #fmt["%s%s", vstore_to_str(cx, vs), ty] }
109+
}
110+
}
111+
103112
fn tys_to_str(cx: ctxt, ts: ~[t]) -> str {
104113
let mut rs = "";
105114
for ts.each |t| { rs += ty_to_str(cx, t); }
@@ -223,14 +232,9 @@ fn ty_to_str(cx: ctxt, typ: t) -> str {
223232
parameterized(cx, base, substs.self_r, substs.tps)
224233
}
225234
ty_evec(mt, vs) {
226-
alt vs {
227-
ty::vstore_fixed(_) {
228-
#fmt["[%s]/%s", mt_to_str(cx, mt), vstore_to_str(cx, vs)]
229-
}
230-
_ { #fmt["%s[%s]", vstore_to_str(cx, vs), mt_to_str(cx, mt)] }
231-
}
235+
vstore_ty_to_str(cx, #fmt["[%s]", mt_to_str(cx, mt)], vs)
232236
}
233-
ty_estr(vs) { #fmt["str/%s", vstore_to_str(cx, vs)] }
237+
ty_estr(vs) { vstore_ty_to_str(cx, "str", vs) }
234238
ty_opaque_box { "@?" }
235239
ty_constr(t, _) { "@?" }
236240
ty_opaque_closure_ptr(ck_block) { "closure&" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected `str/~` but found `int`
1+
// error-pattern:expected `~str` but found `int`
22

33
const i: str = 10i;
44
fn main() { log(debug, i); }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:^ cannot be applied to type `str/~`
1+
// error-pattern:^ cannot be applied to type `~str`
22

33
fn main() { let x = "a" ^ "b"; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// error-pattern:expected `str/~` but found `~[int]`
1+
// error-pattern:expected `~str` but found `~[int]`
22
fn main() { fail ~[0i]; }

trunk/src/test/compile-fail/map-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import std::map::map;
88
fn main() {
99
let x: map<str,str> = map::str_hash::<str>() as map::<str,str>;
1010
let y: map<uint,str> = x;
11-
//~^ ERROR mismatched types: expected `std::map::map<uint,str/~>`
11+
//~^ ERROR mismatched types: expected `std::map::map<uint,~str>`
1212
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:cannot apply unary operator `-` to type `str/~`
1+
// error-pattern:cannot apply unary operator `-` to type `~str`
22

33
fn main() { -"foo"; }

trunk/src/test/compile-fail/missing-do.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fn foo(f: fn()) { f() }
44

55
fn main() {
6-
"" || 42; //~ ERROR binary operation || cannot be applied to type `str/~`
6+
"" || 42; //~ ERROR binary operation || cannot be applied to type `~str`
77
foo || {}; //~ ERROR binary operation || cannot be applied to type `extern fn(fn())`
88
//~^ NOTE did you forget the 'do' keyword for the call?
99
}

0 commit comments

Comments
 (0)