2019-04-22 07:40:08 +00:00
error[E0382]: borrow of moved value: `start`
2018-12-25 15:56:47 +00:00
--> $DIR/walk-struct-literal-with.rs:16:20
2018-08-08 12:28:26 +00:00
|
2019-04-22 07:40:08 +00:00
LL | let start = Mine{test:"Foo".to_string(), other_val:0};
| ----- move occurs because `start` has type `Mine`, which does not implement the `Copy` trait
2018-08-08 12:28:26 +00:00
LL | let end = Mine{other_val:1, ..start.make_string_bar()};
2020-06-11 17:48:46 +00:00
| ----------------- `start` moved due to this method call
2019-03-09 12:03:44 +00:00
LL | println!("{}", start.test);
2019-04-22 07:40:08 +00:00
| ^^^^^^^^^^ value borrowed here after move
2020-06-11 17:48:46 +00:00
|
2022-12-12 12:07:09 +00:00
note: `Mine::make_string_bar` takes ownership of the receiver `self`, which moves `start`
2020-06-11 17:48:46 +00:00
--> $DIR/walk-struct-literal-with.rs:7:28
|
LL | fn make_string_bar(mut self) -> Mine{
| ^^^^
2022-06-21 02:25:52 +00:00
= 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)
2018-08-08 12:28:26 +00:00
error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`.