about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2018-06-30Auto merge of #51717 - Mark-Simulacrum:snap, r=alexcrichtonbors-1/+0
Bootstrap from 1.28.0 beta
2018-06-30Bootstrap from 1.28.0-beta.3Mark Simulacrum-1/+0
2018-06-29liballoc docs: Remove “not intended for general usage”Simon Sapin-4/+4
2018-06-29Rename alloc::arc to alloc::sync, to match std::syncSimon Sapin-3/+3
2018-06-29Remove the Vec and String reexports at the root of the alloc crateSimon Sapin-5/+0
… since `std` has no corresponding reexports. Use `alloc::vec::Vec` and `alloc::string::String` instead.
2018-06-29Move core::alloc::CollectionAllocErr to alloc::collectionsSimon Sapin-5/+34
2018-06-29Move some alloc crate top-level items to a new alloc::collections moduleSimon Sapin-42/+65
This matches std::collections
2018-06-29Remove the unstable alloc::allocator module reexport, deprecated since 1.27Simon Sapin-7/+0
2018-06-29Make raw_vec perma-unstable and hiddenSimon Sapin-2/+5
2018-06-28Arc: remove unused allocation from Weak::new()Sean McArthur-20/+36
2018-06-27Add str::split_ascii_whitespace.Clar Charr-0/+3
2018-06-26Add `LocalTaskObj`Josef Reinhard Brandl-2/+16
2018-06-22Auto merge of #51463 - estebank:error-codes, r=nikomatsakisbors-2/+8
Various changes to existing diagnostics * [Add code to `invalid ABI` error, add span label, move list to help to make message shorter](https://github.com/rust-lang/rust/pull/51463/commits/23ae5af274defa9ff884f593e44a2bbcaf814a02): ``` error[E0697]: invalid ABI: found `路濫狼á́́` --> $DIR/unicode.rs:11:8 | LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI | ^^^^^^^^^ invalid ABI | = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted ``` * [Add code to incorrect `pub` restriction error](https://github.com/rust-lang/rust/pull/51463/commits/e96fdea8a38f39f99f8b9a4000a689187a457e08) * [Add message to `rustc_on_unimplemented` attributes in core to have them set a custom message _and_ label](https://github.com/rust-lang/rust/pull/51463/commits/2cc7e5ed307aee936c20479cfdc7409d6b52a464): ``` error[E0277]: `W` does not have a constant size known at compile-time --> $DIR/unsized-enum2.rs:33:8 | LL | VA(W), | ^ `W` does not have a constant size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `W` = help: consider adding a `where W: std::marker::Sized` bound = note: no field of an enum variant may have a dynamically sized type ``` ``` error[E0277]: `Foo` cannot be sent between threads safely --> $DIR/E0277-2.rs:26:5 | LL | is_send::<Foo>(); | ^^^^^^^^^^^^^^ `Foo` cannot be sent between threads safely | = help: the trait `std::marker::Send` is not implemented for `Foo` ``` ``` error[E0277]: can't compare `{integer}` with `std::string::String` --> $DIR/binops.rs:16:7 | LL | 5 < String::new(); | ^ no implementation for `{integer} < std::string::String` and `{integer} > std::string::String` | = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}` ``` ``` error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>` --> $DIR/binops.rs:17:7 | LL | 6 == Ok(1); | ^^ no implementation for `{integer} == std::result::Result<{integer}, _>` | = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}` ``` ``` error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32` --> $DIR/type-check-defaults.rs:16:19 | LL | struct WellFormed<Z = Foo<i32, i32>>(Z); | ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>` | = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32` note: required by `Foo` --> $DIR/type-check-defaults.rs:15:1 | LL | struct Foo<T, U: FromIterator<T>>(T, U); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` * [Add link to book for `Sized` errors](https://github.com/rust-lang/rust/pull/51463/commits/1244dc7c283323aea1a3457a4458d590a3e160c8): ``` error[E0277]: `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time --> $DIR/const-unsized.rs:13:29 | LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); | ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static` = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized> = note: constant expressions must have a statically known size ``` * [Point to previous line for single expected token not found](https://github.com/rust-lang/rust/pull/51463/commits/48165168fb0f059d8536cd4a2276b609d4a7f721) (if the current token is in a different line)
2018-06-19Add message to `rustc_on_unimplemented` attributes in coreEsteban Küber-2/+8
2018-06-18Rename OOM to allocation errorSimon Sapin-17/+21
The acronym is not descriptive unless one has seen it before. * Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle. * Rename `set_oom_hook` to `set_alloc_error_hook` * Rename `take_oom_hook` to `take_alloc_error_hook` Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`
2018-06-16Auto merge of #51562 - SimonSapin:transparent, r=cramertjbors-1/+1
Stabilize #[repr(transparent)] Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-13Improve core::task::TaskObjJosef Reinhard Brandl-4/+4
2018-06-12Stabilize #[repr(transparent)]Simon Sapin-1/+1
Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-12Auto merge of #51241 - glandium:globalalloc, r=sfackler,SimonSapinbors-190/+127
Stabilize GlobalAlloc and #[global_allocator] This PR implements the changes discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-393263510 Fixes #49668 Fixes #27389 This does not change the default global allocator: #36963
2018-06-11More alloc docs tweaksSimon Sapin-2/+4
2018-06-11Stabilize alloc::oom (but not set_oom_hook or take_oom_hook)Simon Sapin-1/+1
2018-06-11Stabilize alloc free functions for the global allocators.Simon Sapin-4/+4
2018-06-11Stablize the alloc module without changing stability of its contents.Simon Sapin-6/+5
2018-06-11Document memory allocation APIsSimon Sapin-0/+65
Add some docs where they were missing, attempt to fix them where they were out of date.
2018-06-11Remove some unneeded castsSimon Sapin-3/+3
2018-06-11Remove the deprecated Heap type/constSimon Sapin-9/+0
2018-06-11Remove deprecated heap modulesSimon Sapin-118/+0
The heap.rs file was already unused.
2018-06-11Replace `impl GlobalAlloc for Global` with a set of free functionsMike Hommey-23/+25
2018-06-11Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAllocMike Hommey-47/+43
2018-06-11Auto merge of #51442 - tinaun:more-future-impls, r=cramertjbors-0/+19
[futures] add a few blanket impls to std these were defined in the futures crate, but with the core definitions moving to std these would need to move too.
2018-06-10Stabilize entry-or-defaultGuillaume Gomez-2/+1
2018-06-10Auto merge of #51320 - tmccombs:step-by, r=SimonSapinbors-1/+0
Stabilize Iterator::step_by Fixes #27741
2018-06-08addressed nitstinaun-21/+0
2018-06-08add a few blanket future impls to stdtinaun-0/+40
2018-06-06Auto merge of #51263 - cramertj:futures-in-core, r=aturonbors-0/+239
Add Future and task system to the standard library This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary. r? @aturon
2018-06-06Add Future and task system to the standard libraryTaylor Cramer-0/+239
2018-06-03Reexport fmt::Alignment into stdGuillaume Gomez-0/+2
2018-06-02Stabilize Iterator::step_byThayne McCombs-1/+0
Fixes #27741
2018-06-02Rollup merge of #51312 - frewsxcv:clarify-hash-map-entry-get-mut, r=dtolnayMark Simulacrum-2/+15
Clarify the difference between get_mut and into_mut for OccupiedEntry The examples for both hash_map::OccupiedEntry::get_mut and hash_map::OccupiedEntry::into_mut were almost identical. This led to some confusion over the difference, namely why you would ever use get_mut when into_mut gives alonger lifetime. Reddit thread: https://www.reddit.com/r/rust/comments/8a5swr/why_does_hashmaps This commit adds two lines and a comment to the example, to show that the entry object can be re-used after calling get_mut. Closes https://github.com/rust-lang/rust/issues/49745
2018-06-02Rollup merge of #51306 - kennytm:impl-default-for-mut-str, r=SimonSapinMark Simulacrum-0/+1
impl Default for &mut str Rationale: There is already `impl Default for &mut [T]`. Note: This impl is insta-stable.
2018-06-02Copy changes from HashMap over to BTreeMap.Corey Farwell-2/+15
2018-06-02Rollup merge of #51147 - tmccombs:sliceindex, r=SimonSapinMark Simulacrum-2/+1
Stabilize SliceIndex trait. CC #35729 According to recommendations in https://github.com/rust-lang/rust/issues/35729#issuecomment-377784884
2018-06-03impl Default for &mut strkennytm-0/+1
2018-06-01incorporate changes from code reviewEmerentius-38/+46
further reduce unsafe fn calls reduce right drift assert! sufficient capacity
2018-06-01compacts join codeEmerentius-30/+14
2018-06-01add more join testsEmerentius-0/+22
old tests cover the new fast path of str joining already this adds tests for joining into Strings with long separators (>4 byte) and for joining into Vec<T>, T: Clone + !Copy. Vec<T: Copy> will be specialised when specialisation type inference bugs are fixed.
2018-06-01optimize joining and concatenation for slicesEmerentius-47/+113
for both Vec<T> and String - eliminates the boolean first flag in fn join() for String only - eliminates repeated bounds checks in join(), concat() - adds fast paths for small string separators up to a len of 4 bytes
2018-06-01Stabilize SliceIndex trait.Thayne McCombs-2/+1
Fixes #35729 According to recommendations in https://github.com/rust-lang/rust/issues/35729#issuecomment-377784884
2018-05-31Update `Arc` and `Rc` to use `NonNull::cast` to cast the inner pointersJeremy Fitzhardinge-17/+6
This avoids an `unsafe` block in each case.
2018-05-31Implement `downcast` for `Arc<Any + Send + Sync>`Jeremy Fitzhardinge-0/+64
We only need to implement it for `Any + Send + Sync` because in practice that's the only useful combination for `Arc` and `Any`. Implementation for #44608 under the `rc_downcast` feature.