more precise wording and fixed heap-pinning example which didn't work as expected

This commit is contained in:
Carl Fredrik Samson
2020-04-14 23:38:47 +02:00
parent bd7e3c5572
commit fbef19b079
3 changed files with 19 additions and 21 deletions

View File

@@ -2068,7 +2068,7 @@ after it's initialized like this:</p>
<p>For completeness let's remove some unsafe and the need for an <code>init</code> method
at the cost of a heap allocation. Pinning to the heap is safe so the user
doesn't need to implement any unsafe code:</p>
<pre><pre class="playpen"><code class="language-rust">use std::pin::Pin;
<pre><pre class="playpen"><code class="language-rust edition2018">use std::pin::Pin;
use std::marker::PhantomPinned;
#[derive(Debug)]