mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
librustc: use new [ty, .. len]
syntax for fixed vector errors.
This commit is contained in:
parent
08e2cf846a
commit
28f0782260
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user