Skip to content

Commit

Permalink
auto merge of #5757 : dbaupp/rust/rustc-fixed-vector-pprint, r=thesti…
Browse files Browse the repository at this point in the history
…nger

Currently error messages say ``mismatched types: expected `uint` but found `[uint * 10]` (expected uint but found vector)`` rather than `[uint, .. 10]`.
  • Loading branch information
bors committed Apr 6, 2013
2 parents 77eadc0 + 28f0782 commit 44d4d6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-2149.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion src/test/compile-fail/issue-4517.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 44d4d6d

Please sign in to comment.