Merge pull request #1253 from keith666666/main

Fix: broken link of generator
This commit is contained in:
Philipp Oppermann
2023-11-25 18:16:44 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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` 関数自体のコードです。関数のヘッダは次のように定義されていたことを思い出してください:

View File

@@ -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: