about summary refs log tree commit diff
path: root/src/liballoc/boxed.rs
AgeCommit message (Collapse)AuthorLines
2019-04-23Stabilize futures_apiTaylor Cramer-1/+1
2019-04-15warn(missing_docs) in liballoc, and add missing docsRalf Jung-0/+1
2019-04-11Fix broken links on std::boxed doc pageOliver Middleton-0/+2
2019-04-07Auto merge of #59119 - cramertj:cx-back, r=withoutboatsbors-3/+3
Future-proof the Futures API cc https://github.com/rust-lang/rust/issues/59113, @carllerche, @rust-lang/libs r? @withoutboats
2019-04-05Future-proof the Futures APITaylor Cramer-3/+3
2019-04-05Stabilize boxed_closure_impls in 1.35.0.Charles Lew-9/+3
2019-04-05Remove FnBox specialization of impl FnOnce for Box<impl FnOnce>.Masaki Hara-17/+1
2019-04-05We already have unsized_locals in stage0.Masaki Hara-9/+0
2019-04-05Add Fn* blanket impls for Box.Masaki Hara-0/+33
2019-04-05Make FnBox a subtrait of FnOnce.Masaki Hara-5/+1
2019-03-24Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcmkennytm-0/+3
Implement specialized nth_back() for Box and Windows. Hi there, this is my first pull request to rust :-) I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995. I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.
2019-03-09Use lifetime contravariance to elide more lifetimes in core+alloc+stdScott McMurray-4/+4
2019-02-25Rollup merge of #58686 - hellow554:rustfmt_depr, r=cramertjMazdak Farrokhzad-1/+1
replace deprecated rustfmt_skip with rustfmt::skip
2019-02-24Rollup merge of #58183 - jethrogb:jb/alloc-box-guarantees, r=SimonSapinMazdak Farrokhzad-0/+10
Clarify guarantees for `Box` allocation This basically says `Box` does the obvious things for its allocations. See also: https://users.rust-lang.org/t/alloc-crate-guarantees/24981 This may require a T-libs FCP? Not sure. r? @sfackler
2019-02-23replace deprecated rustfmt_skip with rustfmt::skipMarcel Hellwig-1/+1
2019-02-16implement nth_back for BoxAdrian Friedli-0/+3
2019-02-16Rollup merge of #58429 - RalfJung:box, r=TimNNkennytm-3/+8
fix Box::into_unique effecitvely transmuting to a raw ptr Miri/Stacked Borrows treat `Box` specially: they assert that it is unique, and tag it appropriately. However, currently, `Box::into_inner` is not aware of that and returns a raw pointer (wrapped in a `Unique`) that carries the same tag as the box, meaning it carries a `Uniq` tag. This leads to all sorts of problems when people use the raw pointer they get out of the `Unique` type. In the future, it'd be interesting to make `Unique` also carry some kind of uniqueness. In that case, something like this would instead be needed whenever a raw pointer is extracted from a `Unique`. However, that is out-of-scope for the current version of Stacked Borrows. So until then, this changes `into_unique` to perform a proper reference-to-raw-ptr-cast, which clears the tag.
2019-02-13fix Box::into_unique effecitvely transmuting to a raw ptrRalf Jung-3/+8
2019-02-13Clarify guarantees for `Box` allocationJethro Beekman-0/+10
2019-02-03Update the future/task APIMatthias Einwag-3/+3
This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592. Changes: - Replacing UnsafeWake with RawWaker and RawWakerVtable - Removal of LocalWaker - Removal of Arc-based Wake trait
2019-02-03liballoc: revert nested imports style changes.Mazdak Farrokhzad-20/+18
2019-02-02liballoc: fix some idiom lints.Mazdak Farrokhzad-3/+3
2019-02-02liballoc: elide some lifetimes.Mazdak Farrokhzad-2/+2
2019-02-02liballoc: refactor & fix some imports.Mazdak Farrokhzad-18/+20
2019-02-02liballoc: cargo check passes on 2018Mazdak Farrokhzad-3/+3
2019-01-27impl Generator for Pin<Box<Generator>>Wim Looman-0/+10
2019-01-27Change generator trait to use pinningWim Looman-7/+6
2019-01-03Add discoverable function for converting Box<T> -> Pin<Box<T>>Wim Looman-4/+14
2019-01-03Allow converting Box<T: !Sized> -> Pin<Box<T>>Wim Looman-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-24Rollup merge of #55470 - daniellimws:box-from-docs, r=CentrilMazdak Farrokhzad-0/+54
box: Add documentation for `From` impls This is a part of #51430. A brief description of the behaviour and examples are added to the documentation. I am not sure what sort of examples to put for the `From` for `Pin` as my [code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=97c908f44e41c9faeffec5b61d72a03e) doesn't even manage to compile using the nightly build. Somehow I feel that I missed out something so do let me know if more information is needed in the documentation or any of the examples require change.
2018-12-21Rename Box/Arc/Rc::pinned to ::pinTaylor Cramer-1/+3
2018-12-21Stabilize PinTaylor Cramer-3/+3
2018-12-20Stabilize `Rc`, `Arc` and `Pin` as method receiversMichael Hewson-1/+6
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-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-05Fix error in example by adding type annotationdaniellimws-1/+1
2018-11-20Incorporate `dyn` into more comments and docs.Corey Farwell-8/+8
2018-11-17Add double quotes to resolve errordaniellimws-1/+1
2018-11-11change attribute to stableAxary-1/+1
2018-11-10add FromIterator<A> to Box<[A]>Axary-1/+9
2018-11-01Replace CoerceSized trait with DispatchFromDynMichael Hewson-3/+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/+4
This will make receiver types like `Rc<Self>` and `Pin<&mut Self>` object-safe.
2018-10-29Fix documentation for those that allocate on heapdaniellimws-3/+4
2018-10-29Add documentation for From implsdaniellimws-0/+53
2018-09-28Indicate how to move value out of Box in docs.Corey Farwell-2/+13
Fixes https://github.com/rust-lang/rust/issues/53634.
2018-09-19Remove spawning from task::ContextTaylor Cramer-67/+4
2018-09-19Auto merge of #53877 - withoutboats:compositional-pin, r=aturonbors-10/+32
Update to a new pinning API. ~~Blocked on #53843 because of method resolution problems with new pin type.~~ @r? @cramertj cc @RalfJung @pythonesque anyone interested in #49150
2018-09-17Cleanup and fix method resolution issueTaylor Cramer-1/+5
2018-09-06Fix typos.Without Boats-2/+2
2018-09-05Add comment.Without Boats-0/+22