From fed1ab75e41b7cf6f56e60ef918c320490ed3f29 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 5 Jun 2020 10:33:15 -0500 Subject: [PATCH] Clarify some wording a bit It's not just that we add something to the end, it's also that we need to hold onto the reference. FIxes #1785 --- src/ch08-01-vectors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch08-01-vectors.md b/src/ch08-01-vectors.md index 7df92724de..582f173bf1 100644 --- a/src/ch08-01-vectors.md +++ b/src/ch08-01-vectors.md @@ -138,7 +138,7 @@ and any other references to the contents of the vector remain valid. Recall the rule that states you can’t have mutable and immutable references in the same scope. That rule applies in Listing 8-7, where we hold an immutable reference to the first element in a vector and try to add an element to the end, which won’t -work. +work if we also try to refer to that element later in the function: ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch08-common-collections/listing-08-07/src/main.rs:here}}