summary refs log tree commit diff
path: root/src/libcore/pin.rs
AgeCommit message (Collapse)AuthorLines
2019-02-22improve Pin documentationRalf Jung-42/+294
Incorporates a bunch of the documentation-related comments that came up when discussing `Pin` stabilization.
2019-01-07Reborrow Pin<P> using &mut in `Pin::set`Taylor Cramer-2/+2
This makes it possible to call `.set` multiple times without using `.as_mut()` first to reborrow the pointer.
2018-12-27Fix typo in pin documentationSean Griffin-1/+1
Affect is a verb, effect is a noun
2018-12-21Fix Unpin docs linkTaylor Cramer-1/+1
2018-12-21Rename Box/Arc/Rc::pinned to ::pinTaylor Cramer-1/+1
2018-12-21Pin stabilization: fix doctestsTaylor Cramer-3/+1
2018-12-21Stabilize PinTaylor Cramer-20/+20
2018-12-21Update Pin API to match the one proposed for stabilizationTaylor Cramer-19/+14
Remove pin::Unpin reexport and add Unpin to the prelude. Change Pin associated functions to methods. Rename get_mut_unchecked_ to get_unchecked_mut Remove impl Unpin for Pin Mark Pin repr(transparent)
2018-12-20Stabilize `Rc`, `Arc` and `Pin` as method receiversMichael Hewson-1/+4
This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use. This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled. This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.
2018-12-12Rename Pinned marker type to PhantomPinnedTaylor Cramer-4/+7
2018-12-12Expand documantation for std::pin moduleTaylor Cramer-15/+22
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-09Fix docstring spelling mistakesDaniel Alley-2/+2
2018-11-01Replace CoerceSized trait with DispatchFromDynMichael Hewson-4/+3
Rename `CoerceSized` to `DispatchFromDyn`, and reverse the direction so that, for example, you write ``` impl<T: Unsize<U>, U> DispatchFromDyn<*const U> for *const T {} ``` instead of ``` impl<T: Unsize<U>, U> DispatchFromDyn<*const T> for *const U {} ``` this way the trait is really just a subset of `CoerceUnsized`. The checks in object_safety.rs are updated for the new trait, and some documentation and method names in there are updated for the new trait name — e.g. `receiver_is_coercible` is now called `receiver_is_dispatchable`. Since the trait now works in the opposite direction, some code had to updated here for that too. I did not update the error messages for invalid `CoerceSized` (now `DispatchFromDyn`) implementations, except to find/replace `CoerceSized` with `DispatchFromDyn`. Will ask for suggestions in the PR thread.
2018-11-01Add CoerceSized impls throughout libstdMichael Hewson-1/+8
This will make receiver types like `Rc<Self>` and `Pin<&mut Self>` object-safe.
2018-10-23fix typos in various placesMatthias Krüger-1/+1
2018-09-26Remove useless lifetimes from `Pin` `impl`s.Alexander Ronald Altman-5/+5
2018-09-18Cleanup Deref impls and add ?Sized bound to &mut T implsTaylor Cramer-4/+4
2018-09-17Cleanup and fix method resolution issueTaylor Cramer-49/+93
2018-09-01Update to a new pinning API.Without Boats-74/+198
2018-08-25remove copyright headers now that they are not madatoryNiv Kaminer-10/+0
2018-08-23link to items in pin module to std docsNiv Kaminer-2/+2
2018-08-23capitalize and punctuate libcore pin moduleNiv Kaminer-1/+1
2018-08-23fix broken link to Unpin due to reexportNiv Kaminer-1/+1
2018-08-23fix PinMut documentationNiv Kaminer-4/+8
2018-08-23add top-level documentation to the std pin moduleNiv Kaminer-0/+4
2018-08-23move PinMut into pin module and export through stdNiv Kaminer-0/+162