fork/rust

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

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

master
1.0 KiB20 linesraw
1error[E0382]: borrow of moved value: `start`
2  --> $DIR/walk-struct-literal-with.rs:16:20
3   |
4LL |     let start = Mine{test:"Foo".to_string(), other_val:0};
5   |         ----- move occurs because `start` has type `Mine`, which does not implement the `Copy` trait
6LL |     let end = Mine{other_val:1, ..start.make_string_bar()};
7   |                                         ----------------- `start` moved due to this method call
8LL |     println!("{}", start.test);
9   |                    ^^^^^^^^^^ value borrowed here after move
10   |
11note: `Mine::make_string_bar` takes ownership of the receiver `self`, which moves `start`
12  --> $DIR/walk-struct-literal-with.rs:7:28
13   |
14LL |     fn make_string_bar(mut self) -> Mine{
15   |                            ^^^^
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
18error: aborting due to previous error
19
20For more information about this error, try `rustc --explain E0382`.