Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change rustc pretty-printing to print [T, ..n] instead of [T, .. n]
  • Loading branch information
ftxqxd committed Oct 3, 2014
1 parent 073a1ab commit f56c67b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/librustc/util/ppaux.rs
Expand Up @@ -427,7 +427,7 @@ pub fn ty_to_string(cx: &ctxt, typ: t) -> String {
ty_vec(t, sz) => {
match sz {
Some(n) => {
format!("[{}, .. {}]", ty_to_string(cx, t), n)
format!("[{}, ..{}]", ty_to_string(cx, t), n)
}
None => format!("[{}]", ty_to_string(cx, t)),
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/dst-bad-coerce1.rs
Expand Up @@ -22,7 +22,7 @@ pub fn main() {
let f1 = Fat { ptr: [1, 2, 3] };
let f2: &Fat<[int, ..3]> = &f1;
let f3: &Fat<[uint]> = f2;
//~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int, .. 3]>`
//~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int, ..3]>`

// With a trait.
let f1 = Fat { ptr: Foo };
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/dst-bad-coerce4.rs
Expand Up @@ -18,5 +18,5 @@ pub fn main() {
// With a vec of ints.
let f1: &Fat<[int]> = &Fat { ptr: [1, 2, 3] };
let f2: &Fat<[int, ..3]> = f1;
//~^ ERROR mismatched types: expected `&Fat<[int, .. 3]>`, found `&Fat<[int]>`
//~^ ERROR mismatched types: expected `&Fat<[int, ..3]>`, found `&Fat<[int]>`
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-13482.rs
Expand Up @@ -12,7 +12,7 @@ fn main() {
let x = [1,2];
let y = match x {
[] => None,
//~^ ERROR expected `[<generic integer #0>, .. 2]`, found a fixed vector pattern of size 0
//~^ ERROR expected `[<generic integer #0>, ..2]`, found a fixed vector pattern of size 0
[a,_] => Some(a)
};
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-14845.rs
Expand Up @@ -16,9 +16,9 @@ struct X {
fn main() {
let x = X { a: [0] };
let _f = &x.a as *mut u8;
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, ..1]`

let local = [0u8];
let _v = &local as *mut u8;
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
//~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, ..1]`
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-17441.rs
Expand Up @@ -10,7 +10,7 @@

fn main() {
let _foo = &[1u, 2] as [uint];
//~^ ERROR cast to unsized type: `&[uint, .. 2]` as `[uint]`
//~^ ERROR cast to unsized type: `&[uint, ..2]` as `[uint]`
//~^^ NOTE consider using an implicit coercion to `&[uint]` instead
let _bar = box 1u as std::fmt::Show;
//~^ ERROR cast to unsized type: `Box<uint>` as `core::fmt::Show`
Expand All @@ -19,6 +19,6 @@ fn main() {
//~^ ERROR cast to unsized type: `uint` as `core::fmt::Show`
//~^^ NOTE consider using a box or reference as appropriate
let _quux = [1u, 2] as [uint];
//~^ ERROR cast to unsized type: `[uint, .. 2]` as `[uint]`
//~^ ERROR cast to unsized type: `[uint, ..2]` as `[uint]`
//~^^ NOTE consider using a box or reference as appropriate
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-2149.rs
Expand Up @@ -22,5 +22,5 @@ impl<A> vec_monad<A> for Vec<A> {
}
fn main() {
["hi"].bind(|x| [x] );
//~^ ERROR type `[&str, .. 1]` does not implement any method in scope named `bind`
//~^ ERROR type `[&str, ..1]` does not implement any method in scope named `bind`
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-4517.rs
Expand Up @@ -13,6 +13,6 @@ fn bar(int_param: int) {}
fn main() {
let foo: [u8, ..4] = [1u8, ..4u];
bar(foo);
//~^ ERROR mismatched types: expected `int`, found `[u8, .. 4]`
//~^ ERROR mismatched types: expected `int`, found `[u8, ..4]`
// (expected int, found vector)
}

0 comments on commit f56c67b

Please sign in to comment.