about summary refs log tree commit diff
path: root/src/liballoc/boxed.rs
AgeCommit message (Collapse)AuthorLines
2018-09-01Update to a new pinning API.Without Boats-10/+28
2018-09-01Implement Unpin for Box, Rc, and ArcWithout Boats-0/+3
2018-08-23attempt to work around Box<T> not being recognized as local typeNiv Kaminer-0/+8
2018-08-23move PinBox into pin module and export through stdNiv Kaminer-202/+0
2018-08-23move PinMut into pin module and export through stdNiv Kaminer-1/+2
2018-08-21Rollup merge of #53329 - frewsxcv:frewsxcv-ptr-add-sub, r=RalfJungkennytm-1/+1
Replace usages of ptr::offset with ptr::{add,sub}. Rust provides these helper methods – so let's use them!
2018-08-20Document Box::into_raw returns non-null ptrEvan Simmons-1/+3
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-1/+1
2018-08-06Rename Executor trait to SpawnJosef Reinhard Brandl-5/+8
2018-07-24Impl Executor for Box<E: Executor>tinaun-1/+14
2018-07-24Auto merge of #52189 - cuviper:static-box-leak, r=blussbors-1/+3
doc: Clarify the lifetime returned by `Box::leak` `Box::leak` mentions that it can return a `'static` reference, but it wasn't immediately clear to me why it doesn't always do so. This is because of the `T: 'a` constraint needed to form a valid reference, and in general we want to be more flexible than requiring `T: 'static`. This patch tries to clarify the relationship between `T` and `'a`.
2018-07-11Revert borked changes in last commit.ljedrz-9/+9
2018-07-10Add missing dyn in liballocljedrz-9/+9
2018-07-10Deny bare trait objects in in src/liballocljedrz-9/+9
2018-07-09doc: Clarify the lifetime returned by `Box::leak`Josh Stone-1/+3
`Box::leak` mentions that it can return a `'static` reference, but it wasn't immediately clear to me why it doesn't always do so. This is because of the `T: 'a` constraint needed to form a valid reference, and in general we want to be more flexible than requiring `T: 'static`. This patch tries to clarify the relationship between `T` and `'a`.
2018-07-02Implemented `UnsafeFutureObj` on `Box`Josef Reinhard Brandl-2/+21
2018-07-02Implement `UnsafeFutureObj` for `&mut Future`Josef Reinhard Brandl-1/+3
2018-07-02`UnsafeFutureObj` impl for `PinMut`Josef Reinhard Brandl-7/+6
2018-07-02Add lifetime to `FutureObj`Josef Reinhard Brandl-8/+9
2018-07-02Use `From` impls for `FutureObj<()>`Josef Reinhard Brandl-12/+12
2018-07-02Make custom trait object for `Future` genericJosef Reinhard Brandl-15/+15
2018-06-26Add `LocalTaskObj`Josef Reinhard Brandl-2/+16
2018-06-13Improve core::task::TaskObjJosef Reinhard Brandl-4/+4
2018-06-08addressed nitstinaun-21/+0
2018-06-08add a few blanket future impls to stdtinaun-0/+39
2018-06-06Add Future and task system to the standard libraryTaylor Cramer-0/+93
2018-05-22Make `Unpin` safe to implementTaylor Cramer-1/+1
2018-05-07Rename Pin to PinMutRalf Jung-3/+3
As discussed at [1] §3 and [2] and [3], a formal look at pinning requires considering a distinguished "shared pinned" mode/typestate. Given that, it seems desirable to at least eventually actually expose that typestate as a reference type. This renames Pin to PinMut, freeing the name Pin in case we want to use it for a shared pinned reference later on. [1] https://www.ralfj.de/blog/2018/04/10/safe-intrusive-collections-with-pinning.html [2] https://github.com/rust-lang/rfcs/pull/2349#issuecomment-379250361 [3] https://github.com/rust-lang/rust/issues/49150#issuecomment-380488275
2018-04-28Rollup merge of #49858 - dmizuk:unique-doc-hidden, r=steveklabnikkennytm-0/+1
std: Mark `ptr::Unique` with `#[doc(hidden)]` `Unique` is now perma-unstable, so let's hide its docs.
2018-04-17Rollup merge of #49555 - nox:inline-into-boxed, r=alexcrichtonkennytm-0/+2
Inline most of the code paths for conversions with boxed slices This helps with the specific problem described in #49541, obviously without making any large change to how inlining works in the general case. Everything involved in the conversions is made `#[inline]`, except for the `<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]` after checking that duplicating the function mentioned in the issue prevented its inlining if I only annotate it with `#[inline]`. For the record, that function was: ```rust pub fn foo() -> Box<[u8]> { vec![0].into_boxed_slice() } ``` To help the inliner's job, we also hoist a `self.capacity() != self.len` check in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.
2018-04-14Cleanup liballoc use statementsMike Hommey-2/+2
Some modules were still using the deprecated `allocator` module, use the `alloc` module instead. Some modules were using `super` while it's not needed. Some modules were more or less ordering them, and other not, so the latter have been modified to match the others.
2018-04-11alloc: Mark `Box::into_unique` with `#[doc(hidden)]`Daiki Mizukami-0/+1
2018-04-05Rollup merge of #49621 - Nemo157:impl-unpin-for-pin, r=withoutboatsAlex Crichton-0/+3
2018-04-05impl Unpin for PinBoxWim Looman-0/+3
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-150/+1
Closes #22181, #27779
2018-04-02Use Alloc and Layout from core::heap.Mike Hommey-1/+2
94d1970bba87f2d2893f6e934e4c3f02ed50604d moved the alloc::allocator module to core::heap, moving e.g. Alloc and Layout out of the alloc crate. While alloc::heap reexports them, it's better to use them from where they really come from.
2018-04-01Inline most of the code paths for conversions with boxed slicesAnthony Ramine-0/+2
This helps with the specific problem described in #49541, obviously without making any large change to how inlining works in the general case. Everything involved in the conversions is made `#[inline]`, except for the `<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]` after checking that duplicating the function mentioned in the issue prevented its inlining if I only annotate it with `#[inline]`. For the record, that function was: ```rust pub fn foo() -> Box<[u8]> { vec![0].into_boxed_slice() } ``` To help the inliner's job, we also hoist a `self.capacity() != self.len` check in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.
2018-03-29Remove unnecessary use core::hash in liballoc/boxed.rsMike Hommey-2/+2
It' only used for hash::Hasher, but Hasher is also imported.
2018-03-25Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertjkennytm-1/+1
Make resuming generators unsafe instead of the creation of immovable generators cc @withoutboats Fixes #47787
2018-03-21Make resuming generators unsafe instead of the creation of immovable ↵John Kåre Alsaker-1/+1
generators. Fixes #47787
2018-03-19Auto merge of #49058 - withoutboats:pin, r=cramertjbors-2/+99
Pin, Unpin, PinBox Implementing rust-lang/rfcs#2349 (do not merge until RFC is merged) @bors r? @cramertj
2018-03-18Update tracking issue.boats-12/+12
2018-03-15Pin and PinBox are fundamental.boats-0/+1
2018-03-15CoerceUnsized for PinBoxboats-0/+3
2018-03-15Add liballoc APIs.boats-2/+95
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-1/+1
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-1/+1
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-02-10stabilize Box::leak: remove #![feature(box_leak)] in docsMazdak Farrokhzad-4/+0
2018-02-10stabilize (version: 1.26.0) Box::leak, cc #46179Mazdak Farrokhzad-2/+1
2018-01-24Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichtonbors-1/+1
Make core::ops::Place an unsafe trait Consumers of `Place` would reasonably expect that the `pointer` function returns a valid pointer to memory that can actually be written to.