Skip to content

Commit

Permalink
Merge pull request #1253 from keith666666/main
Browse files Browse the repository at this point in the history
Fix: broken link of generator
  • Loading branch information
phil-opp authored Nov 25, 2023
2 parents 5b4d04e + 417c225 commit 61d074c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blog/content/edition-2/posts/12-async-await/index.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Futureは `Poll::Ready` を返した後、再びポーリングされるべき

コンパイラが生成するステートマシンとその `Future` traitの実装はこのようになっている**かもしれません**。実際には、コンパイラは異なる方法でコードを生成しています。 (一応、現在は[_generators_]をベースにした実装になっていますが、これはあくまでも実装の詳細です。)

[_generators_]: https://doc.rust-lang.org/nightly/unstable-book/language-features/generators.html
[_generators_]: https://doc.rust-lang.org/stable/unstable-book/language-features/generators.html

パズルの最後のピースは、生成された `example` 関数自体のコードです。関数のヘッダは次のように定義されていたことを思い出してください:

Expand Down
2 changes: 1 addition & 1 deletion blog/content/edition-2/posts/12-async-await/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ Futures should not be polled again after they returned `Poll::Ready`, so we pani

We now know what the compiler-generated state machine and its implementation of the `Future` trait _could_ look like. In practice, the compiler generates code in a different way. (In case you're interested, the implementation is currently based on [_generators_], but this is only an implementation detail.)

[_generators_]: https://doc.rust-lang.org/nightly/unstable-book/language-features/generators.html
[_generators_]: https://doc.rust-lang.org/stable/unstable-book/language-features/generators.html

The last piece of the puzzle is the generated code for the `example` function itself. Remember, the function header was defined like this:

Expand Down

0 comments on commit 61d074c

Please sign in to comment.