]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-consume-unsize-vec.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-consume-unsize-vec.stderr
1 error[E0382]: use of moved value: `b`
2   --> $DIR/borrowck-consume-unsize-vec.rs:8:13
3    |
4 LL | fn foo(b: Box<[i32;5]>) {
5    |        - move occurs because `b` has type `Box<[i32; 5]>`, which does not implement the `Copy` trait
6 LL |     consume(b);
7    |             - value moved here
8 LL |     consume(b);
9    |             ^ value used here after move
10    |
11 note: consider changing this parameter type in function `consume` to borrow instead if owning the value isn't necessary
12   --> $DIR/borrowck-consume-unsize-vec.rs:3:15
13    |
14 LL | fn consume(_: Box<[i32]>) {
15    |    -------    ^^^^^^^^^^ this parameter takes ownership of the value
16    |    |
17    |    in this function
18 help: consider cloning the value if the performance cost is acceptable
19    |
20 LL |     consume(b.clone());
21    |              ++++++++
22
23 error: aborting due to previous error
24
25 For more information about this error, try `rustc --explain E0382`.