From a98de2a76c1e3522ad29269abce81944cc94e7a8 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 31 Mar 2020 16:41:34 +0200 Subject: [PATCH] Fix typo --- blog/content/second-edition/posts/12-async-await/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/content/second-edition/posts/12-async-await/index.md b/blog/content/second-edition/posts/12-async-await/index.md index b74b4ae7..0979f922 100644 --- a/blog/content/second-edition/posts/12-async-await/index.md +++ b/blog/content/second-edition/posts/12-async-await/index.md @@ -703,7 +703,7 @@ As we already saw in this post, the [`Future::poll`] method uses pinning in form fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll ``` -The reason that this method takes `self: Pin<&mut Self>` instead of the normal `&mut self` is that future instances created from async/await are often self-referential, as we saw [above][self-ref-async-await]. By wrapping `Self` into `Pin` and letting the compiler opt-out of `Unpin` for self-referentual futures generated from async/await, it is guaranteed that the futures are not moved in memory between `poll` calls. This ensures that all internal references are still valid. +The reason that this method takes `self: Pin<&mut Self>` instead of the normal `&mut self` is that future instances created from async/await are often self-referential, as we saw [above][self-ref-async-await]. By wrapping `Self` into `Pin` and letting the compiler opt-out of `Unpin` for self-referential futures generated from async/await, it is guaranteed that the futures are not moved in memory between `poll` calls. This ensures that all internal references are still valid. [self-ref-async-await]: @/second-edition/posts/12-async-await/index.md#self-referential-structs