fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
965 B23 linesraw
1error[E0382]: borrow of moved value: `n`
2  --> $DIR/use-after-move-implicity-coerced-object.rs:28:13
3   |
4LL |     let n: Box<_> = Number { n: 42 }.into();
5   |         - move occurs because `n` has type `Box<Number>`, which does not implement the `Copy` trait
6LL |     let mut l: Box<_> = List { list: Vec::new() }.into();
7LL |     l.push(n);
8   |            - value moved here
9LL |
10LL |     let x = n.to_string();
11   |             ^ value borrowed here after move
12   |
13note: consider changing this parameter type in method `push` to borrow instead if owning the value isn't necessary
14  --> $DIR/use-after-move-implicity-coerced-object.rs:17:27
15   |
16LL |     fn push(&mut self, n: Box<dyn ToString + 'static>) {
17   |        ----               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value
18   |        |
19   |        in this method
20
21error: aborting due to previous error
22
23For more information about this error, try `rustc --explain E0382`.