From 45fe0fc9af98a214ed779d2cfac6773bdbfc708e Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 11 Jan 2022 16:47:40 -0500 Subject: [PATCH] Remove an outdated example that says it won't compile but it does Fixes #1656. --- src/ch15-04-rc.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ch15-04-rc.md b/src/ch15-04-rc.md index 6b753b5e4..cea847509 100644 --- a/src/ch15-04-rc.md +++ b/src/ch15-04-rc.md @@ -70,9 +70,8 @@ creating `c`, we’re not allowed to because `a` has been moved. We could change the definition of `Cons` to hold references instead, but then we would have to specify lifetime parameters. By specifying lifetime parameters, we would be specifying that every element in the list will live at -least as long as the entire list. The borrow checker wouldn’t let us compile -`let a = Cons(10, &Nil);` for example, because the temporary `Nil` value would -be dropped before `a` could take a reference to it. +least as long as the entire list. This is the case for the elements and lists +in Listing 15-17, but not in every scenario. Instead, we’ll change our definition of `List` to use `Rc` in place of `Box`, as shown in Listing 15-18. Each `Cons` variant will now hold a value