]> git.lizzy.rs Git - rust.git/blob - src/test/ui/walk-struct-literal-with.stderr
Rollup merge of #73762 - poliorcetics:trait-keyword, r=KodrAus
[rust.git] / src / test / ui / walk-struct-literal-with.stderr
1 error[E0382]: borrow of moved value: `start`
2   --> $DIR/walk-struct-literal-with.rs:16:20
3    |
4 LL |     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
6 LL |     let end = Mine{other_val:1, ..start.make_string_bar()};
7    |                                         ----------------- `start` moved due to this method call
8 LL |     println!("{}", start.test);
9    |                    ^^^^^^^^^^ value borrowed here after move
10    |
11 note: this function consumes the receiver `self` by taking ownership of it, which moves `start`
12   --> $DIR/walk-struct-literal-with.rs:7:28
13    |
14 LL |     fn make_string_bar(mut self) -> Mine{
15    |                            ^^^^
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0382`.