rust/src/test/compile-fail/vec-concat-bug.rs
2012-08-01 19:16:06 -07:00

13 lines
274 B
Rust

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