]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-issue-2657-1.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-issue-2657-1.rs
1 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
2 impl<T> Fake for T { }
3
4
5 fn main() {
6     let x: Option<Box<_>> = Some(Box::new(1));
7     match x {
8       Some(ref _y) => {
9         let _a = x; //~ ERROR cannot move
10         _y.use_ref();
11       }
12       _ => {}
13     }
14 }