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