diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-06-19 19:26:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-19 19:26:25 +0200 |
| commit | 663fb5a0e9c02279bd063b06235e4e8e4bd9fb50 (patch) | |
| tree | 7eae08965799b8e850d6b21e9c10f03f6dc88bb3 /compiler/rustc_interface/src/errors.rs | |
| parent | 689511047a75a30825e367d4fd45c74604d0b15e (diff) | |
| parent | 94f7a7931c035473565c1b2ec0a6c2ffaa3b4f79 (diff) | |
| download | rust-663fb5a0e9c02279bd063b06235e4e8e4bd9fb50.tar.gz rust-663fb5a0e9c02279bd063b06235e4e8e4bd9fb50.zip | |
Rollup merge of #109970 - danielhenrymantilla:add-poll-fn-pin-clarifications, r=thomcc
[doc] `poll_fn`: explain how to `pin` captured state safely Usage of `Pin::new_unchecked(&mut …)` is dangerous with `poll_fn`, even though the `!Unpin`-infectiousness has made things smoother. Nonetheless, there are easy ways to avoid the need for any `unsafe` altogether, be it through `Box::pin`ning, or the `pin!` macro. Since the latter only works within an `async` context, showing an example artificially introducing one ought to help people navigate this subtlety with safety and confidence. ## Preview https://user-images.githubusercontent.com/9920355/230092494-da22fdcb-0b8f-4ff4-a2ac-aa7d9ead077a.mov ```@rustbot``` label +A-docs
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
