rust/src/test/run-pass/unique-assign-generic.rs

12 lines
161 B
Rust

fn f<T: Copy>(t: T) -> T {
let t1 = t;
t1
}
fn main() {
let t = f(~100);
assert t == ~100;
let t = f(~@~[100]);
assert t == ~@~[100];
}