2021-08-24 19:39:40 -05:00
|
|
|
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
|
|
|
|
impl<T> Fake for T { }
|
2018-08-14 18:16:05 -05:00
|
|
|
|
|
|
|
|
2012-06-20 22:08:25 -05:00
|
|
|
fn main() {
|
2021-08-24 19:39:40 -05:00
|
|
|
let x: Option<Box<_>> = Some(Box::new(1));
|
2014-06-27 14:30:25 -05:00
|
|
|
match x {
|
|
|
|
Some(ref _y) => {
|
|
|
|
let _a = x; //~ ERROR cannot move
|
2018-08-14 18:16:05 -05:00
|
|
|
_y.use_ref();
|
2014-06-27 14:30:25 -05:00
|
|
|
}
|
|
|
|
_ => {}
|
|
|
|
}
|
2012-06-20 22:08:25 -05:00
|
|
|
}
|