rust/tests/ui/walk-struct-literal-with.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
1.0 KiB
Plaintext
Raw Normal View History

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
|
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()};
| ----------------- `start` moved due to this method call
2019-03-09 06:03:44 -06:00
LL | println!("{}", start.test);
| ^^^^^^^^^^ value borrowed here after move
|
2022-12-12 06:07:09 -06:00
note: `Mine::make_string_bar` takes ownership of the receiver `self`, which moves `start`
--> $DIR/walk-struct-literal-with.rs:7:28
|
LL | fn make_string_bar(mut self) -> Mine{
| ^^^^
= 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`.