]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch13-functional-features/listing-13-08/output.txt
7a39ac61844493092eb2873d4e559d4d99d7885b
[rustc.git] / src / doc / book / listings / ch13-functional-features / listing-13-08 / output.txt
1 $ cargo run
2 Compiling rectangles v0.1.0 (file:///projects/rectangles)
3 error[E0507]: cannot move out of `value`, a captured variable in an `FnMut` closure
4 --> src/main.rs:18:30
5 |
6 15 | let value = String::from("by key called");
7 | ----- captured outer variable
8 16 |
9 17 | list.sort_by_key(|r| {
10 | ______________________-
11 18 | | sort_operations.push(value);
12 | | ^^^^^ move occurs because `value` has type `String`, which does not implement the `Copy` trait
13 19 | | r.width
14 20 | | });
15 | |_____- captured by this `FnMut` closure
16
17 For more information about this error, try `rustc --explain E0507`.
18 error: could not compile `rectangles` due to previous error