]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-loan-blocks-move.rs
When using value after move, point at span of local
[rust.git] / src / test / ui / borrowck / borrowck-loan-blocks-move.rs
1 #![feature(box_syntax)]
2
3
4
5 fn take(_v: Box<isize>) {
6 }
7
8 fn box_imm() {
9     let v = box 3;
10     let w = &v;
11     take(v); //~ ERROR cannot move out of `v` because it is borrowed
12     w.use_ref();
13 }
14
15 fn main() {
16 }
17
18 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
19 impl<T> Fake for T { }