rustlings/exercises/move_semantics/move_semantics5.rs
IloveKanade 4adfa82e1a my rustlng answer 4.1.2 ~ 4.3
Signed-off-by: IloveKanade <xjlgxlgx@gmail.com>
2022-04-25 16:19:47 +08:00

15 lines
326 B
Rust

// move_semantics5.rs
// Make me compile only by reordering the lines in `main()`, but without
// adding, changing or removing any of them.
// Execute `rustlings hint move_semantics5` for hints :)
// I AM NOT DONE
fn main() {
let mut x = 100;
let y = &mut x;
*y += 100;
x += 1000;
assert_eq!(x, 1200);
}