From 896d4bdce859b86f138b01594035333275a56abd Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Wed, 2 Aug 2017 18:32:42 -0400 Subject: [PATCH] fixup --- src/destructors.md | 6 +++--- src/dropck-eyepatch.md | 2 +- src/phantom-data.md | 2 +- src/vec-final.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/destructors.md b/src/destructors.md index eb4eb57..f723f60 100644 --- a/src/destructors.md +++ b/src/destructors.md @@ -26,7 +26,7 @@ you don't want to drop in a `union`. The standard library provides the Consider a custom implementation of `Box`, which might write `Drop` like this: ```rust -#![feature(unique, allocator_api)] +#![feature(allocator_api)] use std::heap::{Heap, Alloc, Layout}; use std::mem; @@ -52,7 +52,7 @@ use-after-free the `ptr` because when drop exits, it becomes inaccessible. However this wouldn't work: ```rust -#![feature(allocator_api, unique)] +#![feature(allocator_api)] use std::heap::{Heap, Alloc, Layout}; use std::ptr::drop_in_place; @@ -124,7 +124,7 @@ The classic safe solution to preventing recursive drop and allowing moving out of Self during `drop` is to use an Option: ```rust -#![feature(allocator_api, unique)] +#![feature(allocator_api)] use std::heap::{Alloc, Heap, Layout}; use std::ptr::drop_in_place; diff --git a/src/dropck-eyepatch.md b/src/dropck-eyepatch.md index 62a4539..0975c7e 100644 --- a/src/dropck-eyepatch.md +++ b/src/dropck-eyepatch.md @@ -292,7 +292,7 @@ fn inspect() { } ``` -``` +```text error[E0597]: `*data` does not live long enough --> src/main.rs:37:1 | diff --git a/src/phantom-data.md b/src/phantom-data.md index f9ffb68..1b379ef 100644 --- a/src/phantom-data.md +++ b/src/phantom-data.md @@ -51,7 +51,7 @@ allocation which is used for multiple arrays of different types: ``` use std::marker; -struct HashMap { +struct HashMap { ptr: *mut u8, // The pointer actually stores keys and values // (and hashes, but those aren't generic) diff --git a/src/vec-final.md b/src/vec-final.md index 51dc2ed..c85397d 100644 --- a/src/vec-final.md +++ b/src/vec-final.md @@ -1,7 +1,7 @@ # The Final Code ```rust -#![feature(unique)] +#![feature(shared)] #![feature(allocator_api)] use std::ptr::{Shared, self};