summary refs log tree commit diff
path: root/src/test/ui/issue-4335.stderr
blob: 5840838b823d335dd6c71e1aec61711fcb93042f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function
  --> $DIR/issue-4335.rs:16:17
   |
16 |     id(Box::new(|| *v))
   |                 ^^  - `v` is borrowed here
   |                 |
   |                 may outlive borrowed value `v`
help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword
   |
16 |     id(Box::new(move || *v))
   |                 ^^^^^^^

error[E0507]: cannot move out of borrowed content
  --> $DIR/issue-4335.rs:16:20
   |
16 |     id(Box::new(|| *v))
   |                    ^^ cannot move out of borrowed content

error: aborting due to 2 previous errors