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