rust/src/test/compile-fail/vec-concat-bug.rs
Niko Matsakis 9cf271fe96 De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other
vec routines.
2012-09-19 10:52:59 -07:00

13 lines
279 B
Rust

fn concat<T: Copy>(v: ~[const ~[const T]]) -> ~[T] {
let mut r = ~[];
// Earlier versions of our type checker accepted this:
vec::each(v, |inner: &~[T]| {
//~^ ERROR values differ in mutability
r += *inner; true
});
return r;
}
fn main() {}