diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-07-29 06:11:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-29 06:11:42 +0900 |
| commit | 7c1283a0686893ee7d906168c40d905db909d3a3 (patch) | |
| tree | ef202aef969c3b6f12f91275fa3294d16216ea94 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
| parent | fef1725c0f60616e62b75342ce96412748544725 (diff) | |
| parent | cf402921222bd6b3152c6ed55c7039887d12a4c0 (diff) | |
| download | rust-7c1283a0686893ee7d906168c40d905db909d3a3.tar.gz rust-7c1283a0686893ee7d906168c40d905db909d3a3.zip | |
Rollup merge of #81363 - jonhoo:no-unpin-in-pin-future-impl, r=m-ou-se
Remove P: Unpin bound on impl Future for Pin We can safely produce a `Pin<&mut P::Target>` without moving out of the `Pin` by using `Pin::as_mut` directly. The `Unpin` bound was originally added in #56939 following the recommendation of ``@withoutboats`` in https://github.com/rust-lang/rust/issues/55766#issue-378417538 That comment does not give explicit justification for why the bound should be added. The relevant context was: > [ ] Remove `impl<P> Unpin for Pin<P>` > > This impl is not justified by our standard justification for unpin impls: there is no pointer direction between `Pin<P>` and `P`. Its usefulness is covered by the impls for pointers themselves. > > This futures impl (link to the impl changed in this PR) will need to change to add a `P: Unpin` bound. The decision to remove the unconditional impl of `Unpin for Pin` is sound (these days there is just an auto-impl for when `P: Unpin`). But, I think the decision to also add the `Unpin` bound for `impl Future` may have been unnecessary. Or if that's not the case, I'd be very interested to have the argument for why written down somewhere. The bound _appears_ to not be needed, as demonstrated by the change requiring no unsafe code and by the existence of `Pin::as_mut`.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions
