Skip to content

Commit da64994

Browse files
committed
Fix pretty printer for fixed length vectors.
1 parent 8b66578 commit da64994

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/libsyntax/ast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ pub enum vstore {
386386
#[auto_decode]
387387
#[deriving_eq]
388388
pub enum expr_vstore {
389-
// FIXME (#3469): Change uint to @expr (actually only constant exprs)
390389
expr_vstore_fixed(Option<uint>), // [1,2,3,4]
391390
expr_vstore_uniq, // ~[1,2,3,4]
392391
expr_vstore_box, // @[1,2,3,4]

src/libsyntax/print/pprust.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ pub fn print_type_ex(s: @ps, &&ty: @ast::Ty, print_colons: bool) {
425425
}
426426
print_type(s, mt.ty);
427427
word(s.s, ~" * ");
428-
word(s.s, fmt!("%?", v));
428+
print_expr(s, v);
429429
word(s.s, ~"]");
430430
}
431431
ast::ty_mac(_) => {
@@ -1015,7 +1015,7 @@ pub fn print_mac(s: @ps, m: ast::mac) {
10151015
10161016
pub fn print_vstore(s: @ps, t: ast::vstore) {
10171017
match t {
1018-
ast::vstore_fixed(Some(i)) => word(s.s, fmt!("%?", i)),
1018+
ast::vstore_fixed(Some(i)) => word(s.s, fmt!("%u", i)),
10191019
ast::vstore_fixed(None) => word(s.s, ~"_"),
10201020
ast::vstore_uniq => word(s.s, ~"~"),
10211021
ast::vstore_box => word(s.s, ~"@"),
@@ -1028,7 +1028,7 @@ pub fn print_vstore(s: @ps, t: ast::vstore) {
10281028
10291029
pub fn print_expr_vstore(s: @ps, t: ast::expr_vstore) {
10301030
match t {
1031-
ast::expr_vstore_fixed(Some(i)) => word(s.s, fmt!("%?", i)),
1031+
ast::expr_vstore_fixed(Some(i)) => word(s.s, fmt!("%u", i)),
10321032
ast::expr_vstore_fixed(None) => word(s.s, ~"_"),
10331033
ast::expr_vstore_uniq => word(s.s, ~"~"),
10341034
ast::expr_vstore_box => word(s.s, ~"@"),

0 commit comments

Comments
 (0)