We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e17994 commit 6d988dcCopy full SHA for 6d988dc
library/core/src/panic/unwind_safe.rs
@@ -281,6 +281,7 @@ impl<F: Future> Future for AssertUnwindSafe<F> {
281
type Output = F::Output;
282
283
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
284
+ // SAFETY: pin projection. AssertUnwindSafe follows structural pinning.
285
let pinned_field = unsafe { Pin::map_unchecked_mut(self, |x| &mut x.0) };
286
F::poll(pinned_field, cx)
287
}
@@ -291,6 +292,7 @@ impl<S: Stream> Stream for AssertUnwindSafe<S> {
291
292
type Item = S::Item;
293
294
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<S::Item>> {
295
296
unsafe { self.map_unchecked_mut(|x| &mut x.0) }.poll_next(cx)
297
298
0 commit comments