rust/library/core/src
Yuki Okushi 7c1283a068
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`.
2021-07-29 06:11:42 +09:00
..
alloc docs: GlobalAlloc: Make example only require 4096-aligned static 2021-07-21 12:37:59 +01:00
array from review: add a comment why try_fold was chosen instead of fold 2021-07-27 00:14:19 +02:00
char Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
convert Added diagnostic items to structs and traits for Clippy 2021-07-15 23:57:02 +02:00
fmt Auto merge of #86048 - nbdd0121:no_floating_point, r=Amanieu 2021-07-04 14:18:57 +00:00
future Merge branch 'master' into no-unpin-in-pin-future-impl 2021-05-26 19:04:38 -07:00
hash Add tracking issue and rename to hash_one 2021-06-24 01:30:48 -07:00
iter Rollup merge of #87034 - mgeier:doc-step_by, r=JohnTitor 2021-07-23 19:27:43 +09:00
macros Mark format_args_nl as #[doc(hidden)] 2021-07-23 19:04:07 +02:00
mem DOC: remove unnecessary feature crate attribute from example code 2021-07-24 11:27:42 +02:00
num Rollup merge of #87500 - Smittyvb:min-max-docs, r=kennytm 2021-07-28 18:28:18 +09:00
ops Update range.rs 2021-07-27 16:14:48 -04:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
ptr Add reference to tracking issue #86302 for const_ptr_write 2021-06-27 12:05:19 +02:00
slice Stabilize const_fn_union 2021-07-27 16:03:33 -04:00
str Stabilize const_fn_transmute 2021-07-27 16:03:09 -04:00
stream Remove Stream::next 2021-01-23 16:54:56 +01:00
sync Fix typo in core::sync::atomic::compiler_fence example 2021-07-06 10:53:14 -03:00
task Update stable version of ready!() macro. 2021-07-28 16:56:12 +02:00
unicode Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
any.rs Added diagnostic items to structs and traits for Clippy 2021-07-15 23:57:02 +02:00
ascii.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
bool.rs Fix tracking issue for bool_to_option 2021-07-10 18:43:52 -04:00
borrow.rs Fix borrow and deref 2021-03-03 11:23:29 +01:00
cell.rs fix typo: whenver -> whenever 2021-07-26 22:12:35 +01:00
clone.rs Updates Clone docs for Copy comparison. 2021-06-10 11:28:26 -04:00
cmp.rs Added diagnostic items to functions for Clippy 2021-07-15 23:47:03 +02:00
default.rs Permit deriving default on enums with #[default] 2021-07-27 15:47:47 -04:00
ffi.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
hint.rs Auto merge of #84725 - sebpop:arm64-isb, r=joshtriplett 2021-05-02 04:54:31 +00:00
internal_macros.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
intrinsics.rs Stabilize const_fn_transmute 2021-07-27 16:03:09 -04:00
lazy.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
lib.rs Rollup merge of #81363 - jonhoo:no-unpin-in-pin-future-impl, r=m-ou-se 2021-07-29 06:11:42 +09:00
marker.rs Rename variable 2021-06-29 20:26:37 -04:00
option.rs Auto merge of #87196 - oxalica:option-insert-must-use, r=joshtriplett 2021-07-19 07:03:36 +00:00
panic.rs Implement new panic!() behaviour for Rust 2021. 2021-01-25 13:48:11 +01:00
panicking.rs Fix panic message of assert_failed_inner 2021-03-13 18:50:43 +08:00
pin.rs Link tracking issue for pin_deref_mut 2021-07-06 16:59:45 -07:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
result.rs Auto merge of #86211 - tlyu:option-result-overviews, r=joshtriplett 2021-07-14 05:10:57 +00:00
time.rs Added diagnostic items to structs and traits for Clippy 2021-07-15 23:57:02 +02:00
tuple.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
unit.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00