From 13b2ee29e06910477f18faf04f019aad0f390f5b Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sat, 24 Jul 2021 21:30:49 -0400 Subject: [PATCH] Clarify a detail around move. Fixes #2413. --- src/ch04-01-what-is-ownership.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ch04-01-what-is-ownership.md b/src/ch04-01-what-is-ownership.md index fad2f7e3f8..3d7712fb34 100644 --- a/src/ch04-01-what-is-ownership.md +++ b/src/ch04-01-what-is-ownership.md @@ -304,10 +304,10 @@ safety bugs we mentioned previously. Freeing memory twice can lead to memory corruption, which can potentially lead to security vulnerabilities. To ensure memory safety, there’s one more detail to what happens in this -situation in Rust. Instead of trying to copy the allocated memory, Rust -considers `s1` to no longer be valid and, therefore, Rust doesn’t need to free -anything when `s1` goes out of scope. Check out what happens when you try to -use `s1` after `s2` is created; it won’t work: +situation in Rust. After `let s2 = s1`, Rust considers `s1` to no longer be +valid. Therefore, Rust doesn’t need to free anything when `s1` goes out of +scope. Check out what happens when you try to use `s1` after `s2` is created; +it won’t work: ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs:here}}