about summary refs log tree commit diff
path: root/src/liballoc/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-186/+0
2020-07-26Auto merge of #74060 - kpp:remove_length_at_most_32, r=dtolnaybors-1/+0
Remove trait LengthAtMost32 This is a continuation of https://github.com/rust-lang/rust/pull/74026 preserving the original burrbull's commit. I talked to @burrbull, he suggested me to finish his PR.
2020-07-16apply bootstrap cfgsMark Rousskov-1/+0
2020-07-06fixupsJon Gjengset-0/+1
2020-07-05Remove LengthAtMost32Roman Proskuryakov-1/+0
2020-07-03Rollup merge of #73845 - CAD97:weak-as-unsized-ptr, r=RalfJungManish Goregaokar-0/+2
Use &raw in A|Rc::as_ptr This PR uses `&raw` for offsetting `*mut [A]RcInner<T> -> *mut T`. Additionally, this updates the implementation of `Weak::as_ptr` to support unsized `T`, though it does not yet relax the bounds of `Weak::as_ptr`/`into_raw`/`from_raw` to accept unsized `T`.
2020-06-28Do not require ptr validity in rc::data_offsetCAD97-0/+1
2020-06-28Use raw_ref_op in A|Rc::as_ptrCAD97-0/+1
2020-06-28Remove `const_if_match` feature gate from librariesDylan MacKenzie-1/+1
2020-06-19`#[deny(unsafe_op_in_unsafe_fn)]` in liballocLeSeulArtichaut-0/+2
2020-05-29Add Extend::{extend_one,extend_reserve}Josh Stone-0/+1
This adds new optional methods on `Extend`: `extend_one` add a single element to the collection, and `extend_reserve` pre-allocates space for the predicted number of incoming elements. These are used in `Iterator` for `partition` and `unzip` as they shuffle elements one-at-a-time into their respective collections.
2020-05-14Auto merge of #71321 - matthewjasper:alloc-min-spec, r=sfacklerbors-1/+1
Use min_specialization in liballoc - Remove a type parameter from `[A]RcFromIter`. - Remove an implementation of `[A]RcFromIter` that didn't actually specialize anything. - Remove unused implementation of `IsZero` for `Option<&mut T>`. - Change specializations of `[A]RcEqIdent` to use a marker trait version of `Eq`. - Remove `BTreeClone`. I couldn't find a way to make this work with `min_specialization`. - Add `rustc_unsafe_specialization_marker` to `Copy` and `TrustedLen`. After this only libcore is the only standard library crate using `feature(specialization)`. cc #31844
2020-05-03Make BTreeMap::new and BTreeSet::new constLuca Gladiator-0/+1
2020-04-26Use min_specialization in liballocMatthew Jasper-1/+1
- Remove a type parameter from `[A]RcFromIter`. - Remove an implementation of `[A]RcFromIter` that didn't actually specialize anything. - Remove unused implementation of `IsZero` for `Option<&mut T>`. - Change specializations of `[A]RcEqIdent` to use a marker trait version of `Eq`. - Remove `BTreeClone`. I couldn't find a way to make this work with `min_specialization`. - Add `rustc_unsafe_specialization_marker` to `Copy` and `TrustedLen`.
2020-04-25Auto merge of #71556 - Dylan-DPC:rollup-9ll4shr, r=Dylan-DPCbors-1/+0
Rollup of 7 pull requests Successful merges: - #69041 (proc_macro: Stabilize `Span::resolved_at` and `Span::located_at`) - #69813 (Implement BitOr and BitOrAssign for the NonZero integer types) - #70712 (stabilize BTreeMap::remove_entry) - #71168 (Deprecate `{Box,Rc,Arc}::into_raw_non_null`) - #71544 (Replace filter_map().next() calls with find_map()) - #71545 (Fix comment in docstring example for Error::kind) - #71548 (Add missing Send and Sync impls for linked list Cursor and CursorMut.) Failed merges: r? @ghost
2020-04-25Rollup merge of #71168 - SimonSapin:into_raw_non_null, r=AmanieuDylan DPC-1/+0
Deprecate `{Box,Rc,Arc}::into_raw_non_null` Per ongoing FCP at https://github.com/rust-lang/rust/issues/47336#issuecomment-586589016 See also https://github.com/rust-lang/rust/issues/47336#issuecomment-614054164
2020-04-25Bump bootstrap compilerMark Rousskov-1/+1
2020-04-16Dogfood or_patterns in the standard libraryJosh Stone-0/+1
2020-04-15Deprecate `Box::into_raw_non_null`Simon Sapin-1/+0
Per https://github.com/rust-lang/rust/issues/47336#issuecomment-586589016
2020-03-26Fix issues from review and unsoundness of `RawVec::into_box`Tim Diekmann-0/+1
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-0/+1
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-23More explicit; CFG on atomic pointerWithout Boats-0/+1
2020-03-23Add Wake trait for safe construction of Wakers.Without Boats-0/+1
Currently, constructing a waker requires calling the unsafe `Waker::from_raw` API. This API requires the user to manually construct a vtable for the waker themself - which is both cumbersome and very error prone. This API would provide an ergonomic, straightforward and guaranteed memory-safe way of constructing a waker. It has been our longstanding intention that the `Waker` type essentially function as an `Arc<dyn Wake>`, with a `Wake` trait as defined here. Two considerations prevented the original API from being shipped as simply an `Arc<dyn Wake>`: - We want to support futures on embedded systems, which may not have an allocator, and in optimized executors for which this API may not be best-suited. Therefore, we have always explicitly supported the maximally-flexible (but also memory-unsafe) `RawWaker` API, and `Waker` has always lived in libcore. - Because `Waker` lives in libcore and `Arc` lives in liballoc, it has not been feasible to provide a constructor for `Waker` from `Arc<dyn Wake>`. Therefore, the Wake trait was left out of the initial version of the task waker API. However, as Rust 1.41, it is possible under the more flexible orphan rules to implement `From<Arc<W>> for Waker where W: Wake` in liballoc. Therefore, we can now define this constructor even though `Waker` lives in libcore. This PR adds these APIs: - A `Wake` trait, which contains two methods - A required method `wake`, which is called by `Waker::wake` - A provided method `wake_by_ref`, which is called by `Waker::wake_by_ref` and which implementors can override if they can optimize this use case. - An implementation of `From<Arc<W>> for Waker where W: Wake + Send + Sync + 'static` - A similar implementation of `From<Arc<W>> for RawWaker`.
2020-03-20Make std::sync::Arc compatible with ThreadSanitizerTomasz Miąsko-0/+1
The memory fences used previously in Arc implementation are not properly understood by ThreadSanitizer as synchronization primitives. This had unfortunate effect where running any non-trivial program compiled with `-Z sanitizer=thread` would result in numerous false positives. Replace acquire fences with acquire loads when using ThreadSanitizer to address the issue.
2020-01-30Add `#![doc(html_playground_url = ...)]` to alloc crateOliver Middleton-0/+1
This adds the Run button to code examples just like the core and std docs have.
2020-01-14Stabilize ptr::slice_from_raw_parts[_mut]CAD97-1/+0
2019-12-22Format the worldMark Rousskov-14/+13
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-1/+1
2019-12-18no need to bootstrapMark Mansi-1/+1
2019-12-18remove a bit more hackeryMark Mansi-0/+1
2019-12-18Propagate cfg bootstrapMark Rousskov-2/+0
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-1/+1
2019-11-06gate rustc_on_unimplemented under rustc_attrsMazdak Farrokhzad-1/+1
2019-10-22Add Cow::is_borrowed and Cow::is_ownedClar Fon-0/+1
2019-10-13Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichtonMazdak Farrokhzad-1/+1
Split non-CAS atomic support off into target_has_atomic_load_store This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s: * `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations). * ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS). cc #32976 r? @alexcrichton
2019-10-08Stabilize mem::take (mem_take)Jon Gjengset-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08Split non-CAS atomic support off into target_has_atomic_load_storeAmanieu d'Antras-1/+1
2019-09-25Snap cfgs to new betaMark Rousskov-1/+0
2019-09-16Const-stabilize `Vec::new`.Mazdak Farrokhzad-1/+1
2019-09-07Improve hygiene of `alloc::format!`Vadim Petrochenkov-0/+6
2019-08-16Add the Layout of the failed allocation to TryReserveError::AllocErrorSimon Sapin-0/+1
… and add a separately-unstable field to force non-exhaustive matching (`#[non_exhaustive]` is no implemented yet on enum variants) so that we have the option to later expose the allocator’s error value. CC https://github.com/rust-lang/wg-allocators/issues/23
2019-08-14Handle cfg(bootstrap) throughoutMark Rousskov-3/+3
2019-08-08Use associated_type_bounds where applicable - closes #61738Ilija Tovilo-0/+1
2019-08-05Add implementations for converting boxed slices into boxed arraysJake Goulding-1/+1
This mirrors the implementations of reference slices into arrays.
2019-07-30Rollup merge of #63095 - Centril:incomplete-features-lint, r=varkorMazdak Farrokhzad-0/+1
Turn `INCOMPLETE_FEATURES` into lint We do this because it is annoying to see the warning when building rustc and because this is better from a "separation of concerns" POV. The drawback to this change is that this will respect `--cap-lints`. Also note that this is not a buffered lint so if there are fatal parser errors then the lint will not trigger. r? @varkor
2019-07-30Rollup merge of #62469 - czipperz:liballoc-add-doc-links, r=GuillaumeGomezMazdak Farrokhzad-13/+19
Add doc links to liballoc crate page
2019-07-30Allow 'incomplete_features' in libcore/alloc.Mazdak Farrokhzad-0/+1
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-2/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-28Use const generics for some Vec/CCow impls.Mazdak Farrokhzad-0/+2
2019-07-21use a const to hack around promotion limitationsRalf Jung-0/+1