librustc: use new `[ty, .. len]` syntax for fixed vector errors.

This commit is contained in:
Huon Wilson 2013-04-06 13:19:28 +11:00
parent 08e2cf846a
commit 28f0782260
3 changed files with 3 additions and 3 deletions

View File

@ -248,7 +248,7 @@ pub fn trait_store_to_str(cx: ctxt, s: ty::TraitStore) -> ~str {
pub fn vstore_ty_to_str(cx: ctxt, ty: ~str, vs: ty::vstore) -> ~str {
match vs {
ty::vstore_fixed(_) => {
fmt!("[%s * %s]", ty, vstore_to_str(cx, vs))
fmt!("[%s, .. %s]", ty, vstore_to_str(cx, vs))
}
ty::vstore_slice(_) => {
fmt!("%s %s", vstore_to_str(cx, vs), ty)

View File

@ -22,6 +22,6 @@ impl<A> vec_monad<A> for ~[A] {
}
fn main() {
["hi"].bind(|x| [x] );
//~^ ERROR type `[&'static str * 1]` does not implement any method in scope named `bind`
//~^ ERROR type `[&'static str, .. 1]` does not implement any method in scope named `bind`
//~^^ ERROR Unconstrained region variable
}

View File

@ -2,5 +2,5 @@ fn bar(int_param: int) {}
fn main() {
let foo: [u8, ..4] = [1u8, ..4u8];
bar(foo); //~ ERROR mismatched types: expected `int` but found `[u8 * 4]` (expected int but found vector)
bar(foo); //~ ERROR mismatched types: expected `int` but found `[u8, .. 4]` (expected int but found vector)
}