]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // verify that an error is raised when trying to move out of a |
2 | // borrowed path. | |
223e47cc | 3 | |
b7449926 XL |
4 | |
5 | ||
c295e0f8 | 6 | |
223e47cc LB |
7 | |
8 | fn main() { | |
c295e0f8 | 9 | let a: Box<Box<_>> = Box::new(Box::new(2)); |
1a4d82fc JJ |
10 | let b = &a; |
11 | ||
12 | let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed | |
b7449926 | 13 | b.use_ref(); |
223e47cc | 14 | } |
b7449926 XL |
15 | |
16 | trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } } | |
17 | impl<T> Fake for T { } |