mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
15 lines
280 B
Rust
15 lines
280 B
Rust
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
|
|
impl<T> Fake for T { }
|
|
|
|
|
|
fn main() {
|
|
let x: Option<Box<_>> = Some(Box::new(1));
|
|
match x {
|
|
Some(ref _y) => {
|
|
let _a = x; //~ ERROR cannot move
|
|
_y.use_ref();
|
|
}
|
|
_ => {}
|
|
}
|
|
}
|