]> git.lizzy.rs Git - rust.git/blob - tests/ui/liveness/liveness-use-after-send.stderr
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / liveness / liveness-use-after-send.stderr
1 error[E0382]: borrow of moved value: `message`
2   --> $DIR/liveness-use-after-send.rs:16:20
3    |
4 LL | fn test00_start(ch: Chan<Box<isize>>, message: Box<isize>, _count: Box<isize>) {
5    |                                       ------- move occurs because `message` has type `Box<isize>`, which does not implement the `Copy` trait
6 LL |     send(ch, message);
7    |              ------- value moved here
8 LL |     println!("{}", message);
9    |                    ^^^^^^^ value borrowed here after move
10    |
11 note: consider changing this parameter type in function `send` to borrow instead if owning the value isn't necessary
12   --> $DIR/liveness-use-after-send.rs:3:54
13    |
14 LL | fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
15    |    ---- in this function                             ^ this parameter takes ownership of the value
16    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
17 help: consider cloning the value if the performance cost is acceptable
18    |
19 LL |     send(ch, message.clone());
20    |                     ++++++++
21
22 error: aborting due to previous error
23
24 For more information about this error, try `rustc --explain E0382`.