Skip to content

Commit f56c67b

Browse files
committed
Change rustc pretty-printing to print [T, ..n] instead of [T, .. n]
1 parent 073a1ab commit f56c67b

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

src/librustc/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ pub fn ty_to_string(cx: &ctxt, typ: t) -> String {
427427
ty_vec(t, sz) => {
428428
match sz {
429429
Some(n) => {
430-
format!("[{}, .. {}]", ty_to_string(cx, t), n)
430+
format!("[{}, ..{}]", ty_to_string(cx, t), n)
431431
}
432432
None => format!("[{}]", ty_to_string(cx, t)),
433433
}

src/test/compile-fail/dst-bad-coerce1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn main() {
2222
let f1 = Fat { ptr: [1, 2, 3] };
2323
let f2: &Fat<[int, ..3]> = &f1;
2424
let f3: &Fat<[uint]> = f2;
25-
//~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int, .. 3]>`
25+
//~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int, ..3]>`
2626

2727
// With a trait.
2828
let f1 = Fat { ptr: Foo };

src/test/compile-fail/dst-bad-coerce4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ pub fn main() {
1818
// With a vec of ints.
1919
let f1: &Fat<[int]> = &Fat { ptr: [1, 2, 3] };
2020
let f2: &Fat<[int, ..3]> = f1;
21-
//~^ ERROR mismatched types: expected `&Fat<[int, .. 3]>`, found `&Fat<[int]>`
21+
//~^ ERROR mismatched types: expected `&Fat<[int, ..3]>`, found `&Fat<[int]>`
2222
}

src/test/compile-fail/issue-13482.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let x = [1,2];
1313
let y = match x {
1414
[] => None,
15-
//~^ ERROR expected `[<generic integer #0>, .. 2]`, found a fixed vector pattern of size 0
15+
//~^ ERROR expected `[<generic integer #0>, ..2]`, found a fixed vector pattern of size 0
1616
[a,_] => Some(a)
1717
};
1818
}

src/test/compile-fail/issue-14845.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ struct X {
1616
fn main() {
1717
let x = X { a: [0] };
1818
let _f = &x.a as *mut u8;
19-
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
19+
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, ..1]`
2020

2121
let local = [0u8];
2222
let _v = &local as *mut u8;
23-
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
23+
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, ..1]`
2424
}

src/test/compile-fail/issue-17441.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
fn main() {
1212
let _foo = &[1u, 2] as [uint];
13-
//~^ ERROR cast to unsized type: `&[uint, .. 2]` as `[uint]`
13+
//~^ ERROR cast to unsized type: `&[uint, ..2]` as `[uint]`
1414
//~^^ NOTE consider using an implicit coercion to `&[uint]` instead
1515
let _bar = box 1u as std::fmt::Show;
1616
//~^ ERROR cast to unsized type: `Box<uint>` as `core::fmt::Show`
@@ -19,6 +19,6 @@ fn main() {
1919
//~^ ERROR cast to unsized type: `uint` as `core::fmt::Show`
2020
//~^^ NOTE consider using a box or reference as appropriate
2121
let _quux = [1u, 2] as [uint];
22-
//~^ ERROR cast to unsized type: `[uint, .. 2]` as `[uint]`
22+
//~^ ERROR cast to unsized type: `[uint, ..2]` as `[uint]`
2323
//~^^ NOTE consider using a box or reference as appropriate
2424
}

src/test/compile-fail/issue-2149.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ impl<A> vec_monad<A> for Vec<A> {
2222
}
2323
fn main() {
2424
["hi"].bind(|x| [x] );
25-
//~^ ERROR type `[&str, .. 1]` does not implement any method in scope named `bind`
25+
//~^ ERROR type `[&str, ..1]` does not implement any method in scope named `bind`
2626
}

src/test/compile-fail/issue-4517.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ fn bar(int_param: int) {}
1313
fn main() {
1414
let foo: [u8, ..4] = [1u8, ..4u];
1515
bar(foo);
16-
//~^ ERROR mismatched types: expected `int`, found `[u8, .. 4]`
16+
//~^ ERROR mismatched types: expected `int`, found `[u8, ..4]`
1717
// (expected int, found vector)
1818
}

0 commit comments

Comments
 (0)