]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-loan-in-overloaded-op.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-loan-in-overloaded-op.stderr
1 error[E0382]: borrow of moved value: `x`
2   --> $DIR/borrowck-loan-in-overloaded-op.rs:21:20
3    |
4 LL |     let x = Foo(Box::new(3));
5    |         - move occurs because `x` has type `Foo`, which does not implement the `Copy` trait
6 LL |     let _y = {x} + x.clone(); // the `{x}` forces a move to occur
7    |               -    ^^^^^^^^^ value borrowed here after move
8    |               |
9    |               value moved here
10    |
11 help: consider cloning the value if the performance cost is acceptable
12    |
13 LL |     let _y = {x.clone()} + x.clone(); // the `{x}` forces a move to occur
14    |                ++++++++
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0382`.