rust/src/test/compile-fail/vec-concat-bug.rs

14 lines
311 B
Rust
Raw Normal View History

2012-03-22 22:06:01 -05:00
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
//!^^ ERROR values differ in mutability
2012-03-22 22:06:01 -05:00
r += inner;
}
ret r;
}
fn main() {}