Skip to content

Commit 44d1b1d

Browse files
committed
Change rustc pretty-printing to print [T, ..n] instead of [T, .. n]
1 parent 8afba45 commit 44d1b1d

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/librustc/util/ppaux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ pub fn ty_to_string(cx: &ctxt, typ: t) -> String {
428428
ty_vec(t, sz) => {
429429
match sz {
430430
Some(n) => {
431-
format!("[{}, .. {}]", ty_to_string(cx, t), n)
431+
format!("[{}, ..{}]", ty_to_string(cx, t), n)
432432
}
433433
None => format!("[{}]", ty_to_string(cx, t)),
434434
}

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

+1-1
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

+1-1
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

+1-1
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

+2-2
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-2149.rs

+1-1
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

+1-1
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)