2021-08-24 19:39:40 -05:00
|
|
|
fn take(_v: Box<isize>) {
|
|
|
|
}
|
|
|
|
|
2014-05-05 20:56:44 -05:00
|
|
|
|
2018-08-14 18:16:05 -05:00
|
|
|
|
|
|
|
|
2012-05-10 21:58:23 -05:00
|
|
|
|
|
|
|
fn box_imm() {
|
2021-08-24 19:39:40 -05:00
|
|
|
let v = Box::new(3);
|
2018-08-14 18:16:05 -05:00
|
|
|
let w = &v;
|
2013-03-15 14:24:24 -05:00
|
|
|
take(v); //~ ERROR cannot move out of `v` because it is borrowed
|
2018-08-14 18:16:05 -05:00
|
|
|
w.use_ref();
|
2012-05-10 21:58:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|
2018-08-14 18:16:05 -05:00
|
|
|
|
|
|
|
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
|
|
|
|
impl<T> Fake for T { }
|