rust/tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs

8 lines
163 B
Rust
Raw Normal View History

unsafe fn foo(x: *const Box<isize>) -> Box<isize> {
let y = *x; //~ ERROR cannot move out of `*x` which is behind a raw pointer
2012-08-02 00:30:05 +00:00
return y;
}
fn main() {
}