rust/src/liballoc
Michael Hewson 153f5a7892 Stabilize Rc, Arc and Pin as method receivers
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-20 01:14:01 -05:00
..
benches Fix slice's benchmarks 2018-10-10 22:55:12 -07:00
collections Rollup merge of #56672 - ccouzens:master, r=nikic 2018-12-16 14:08:21 +01:00
tests Auto merge of #56550 - chpio:rc-eq, r=alexcrichton 2018-12-19 10:16:05 +00:00
alloc.rs global allocators: add a few comments 2018-11-12 09:01:57 +01:00
borrow.rs Review fix 2018-08-15 22:06:35 +03:00
boxed.rs Stabilize Rc, Arc and Pin as method receivers 2018-12-20 01:14:01 -05:00
boxed_test.rs add FromIterator<A> to Box<[A]> 2018-11-10 11:43:39 +01:00
Cargo.toml std: Activate compiler_builtins mem feature for no_std targets 2018-12-14 09:05:31 -08:00
fmt.rs Rollup merge of #55050 - tshepang:repetition, r=steveklabnik 2018-10-18 12:54:54 +08:00
lib.rs Stabilize Rc, Arc and Pin as method receivers 2018-12-20 01:14:01 -05:00
macros.rs fix some typos 2017-11-21 15:33:45 +01:00
prelude.rs Add the alloc::prelude module 2018-07-07 23:08:43 +02:00
raw_vec.rs Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
rc.rs Stabilize Rc, Arc and Pin as method receivers 2018-12-20 01:14:01 -05:00
slice.rs Auto merge of #56463 - ljedrz:slice_concat_join, r=nikic 2018-12-09 22:39:44 +00:00
str.rs liballoc: mark str.to_owned() and String::from(&str) as #[inline]. 2018-09-27 12:08:03 +02:00
string.rs Fix typo 2018-12-09 14:10:20 -07:00
sync.rs Stabilize Rc, Arc and Pin as method receivers 2018-12-20 01:14:01 -05:00
task.rs Switch to bootstrapping from 1.29 beta 2018-08-01 11:59:08 -06:00
vec.rs Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00