about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2015-06-17More test fixes and fallout of stability changesAlex Crichton-24/+21
2015-06-17std: Move free-functions to associated functionsAlex Crichton-35/+153
This commit moves the free functions in the `rc`, `arc`, and `boxed` modules to associated functions on their respective types, following the recent trend towards this pattern. The previous free functions are all left in-place with `#[deprecated]` pointers towards the new locations. This commit also deprecates `arc::get_mut` and `Arc::make_unique` with no replacement as they are racy in the face of weak pointers.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-33/+30
2015-06-17alloc: Split apart the global `alloc` featureAlex Crichton-25/+34
2015-06-17core: Split apart the global `core` featureAlex Crichton-16/+24
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-15Auto merge of #26265 - retep998:heapalloc, r=alexcrichtonbors-17/+102
This removes our dependency on the CRT for memory allocation.
2015-06-13Switch to direct HeapAlloc on Windows when not using jemallocPeter Atashian-17/+102
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-06-12Auto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturonbors-19/+0
This is a revert of PR #26008 which caused the unintended breakage reported in #26096. We may want to add these implementations in the long run, but for now this revert allows us to take some more time to evaluate the impact of such a change (e.g. run it through crater). Closes #26096
2015-06-09Revert "Added AsRef implementations for Arc and Rc"Alex Crichton-19/+0
This reverts commit 7f3ae0aa26d24100379ae0f3eef29916a32f4e79.
2015-06-09Exise 'owned pointer' from the codebaseSteve Klabnik-3/+3
Still some references left to this old term, I've updated them to say boxes. Related to #25851
2015-06-08Auto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichtonbors-1/+1
r? @eddyb
2015-06-07change some statics to constantsOliver 'ker' Schneider-1/+1
2015-06-06Remove many unneeded feature annotations in the docsSteve Klabnik-3/+0
When things get stabilized, they don't always have their docs updated to remove the gate.
2015-06-04Added AsRef implementations for Arc and RcMarkus Westerlind-0/+19
2015-05-30Mark Arc function get_mut and method make_unique unsafeUlrik Sverdrup-35/+56
This is a temporary mitigation for issue #24880 which points out that these functions are racy in a particular situation where weak pointers exist. To mitigate this, mark the functions unsafe until this can be fixed or another decision is made. This is a breaking change to unstable API, because the new version requires an `unsafe` block. Review carefully if weak pointers may race for any uses of this API and consider abandoning it. [breaking-change]
2015-05-27Remove #[cfg(stage0)] items.Eduard Burtescu-1115/+6
2015-05-24Mark `boxed::into_raw` as safeMichael Layzell-7/+3
By the same logic that `mem::forget` is safe, `boxed::into_raw` is actually a safe function. Fixes #25755.
2015-05-21she -> they in Dining PhilosophersSteve Klabnik-1/+1
Also, when checking for common gendered words elsewhere, I found one 'he', moved to 'they' as well. https://github.com/rust-lang/rust/pull/25640#issuecomment-104304643
2015-05-20Auto merge of #25588 - bluss:doc-string-from, r=alexcrichtonbors-2/+2
Use stable code in doc examples (libcollections) Main task is to change from String::from_str to String::from in examples for String (the latter constructor is stable). While I'm at it, also remove redundant feature flags, fix some other instances of unstable code in examples (in examples for stable methods), and remove some use of usize in examples too.
2015-05-19Fix rebase conflictsAriel Ben-Yehuda-2/+6
2015-05-19fix conflictsAriel Ben-Yehuda-2/+2
2015-05-19collections: Avoid unstable code in examples for StringUlrik Sverdrup-2/+2
Prefer String::from over from_str; String::from_str is unstable while String::from is stable. Promote the latter by using it in examples. Simply migrating unstable function to the closest alternative.
2015-05-17Make `Arc` support DSTsP1start-36/+743
2015-05-16Auto merge of #25462 - alexcrichton:favicon-https, r=nrcbors-1/+1
Helps prevent mixed content warnings if accessing docs over HTTPS. Closes #25459
2015-05-15libs: Move favicon URLs to HTTPSAlex Crichton-1/+1
Helps prevent mixed content warnings if accessing docs over HTTPS. Closes #25459
2015-05-16Allow `?Sized` types in `Rc`’s impls of {Partial,}{Ord,Eq} and BorrowP1start-0/+48
2015-05-13Remove SNAP commentsNick Cameron-8/+8
2015-05-13RebasingNick Cameron-4/+0
2015-05-13Fix a bunch of bugsNick Cameron-2/+4
* segfault due to not copying drop flag when coercing * fat pointer casts * segfault due to not checking drop flag properly * debuginfo for DST smart pointers * unreachable code in drop glue
2015-05-13Make Rc DST-compatibleNick Cameron-7/+382
2015-05-13eddyb's changes for DST coercionsNick Cameron-2/+10
+ lots of rebasing
2015-05-11Rollup merge of #25254 - cgaebel:check-sizes-on-allocate, r=GankroSteve Klabnik-0/+12
They're only enabled in debug builds, but a panic is usually more welcome than UB in debug builds. Previous review at https://github.com/rust-lang/rust/pull/22069 r? @Gankro cc @huon
2015-05-09[liballoc] Adds checks for UB during allocation.Clark Gaebel-0/+12
They're only enabled in debug builds, but a panic is usually more welcome than UB in debug builds.
2015-05-09Convert #[lang="..."] to #[lang = "..."]Nick Hamann-2/+2
In my opinion this looks nicer, but also it matches the whitespace generally used for stability markers more closely.
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-6/+6
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-05Update with correct output.Jan Andersson-1/+1
2015-04-30Add downcasting to std::error::ErrorAaron Turon-3/+8
This commit brings the `Error` trait in line with the [Error interoperation RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting, which has long been intended. This change means that for any `Error` trait objects that are `'static`, you can downcast to concrete error types. To make this work, it is necessary for `Error` to inherit from `Reflect` (which is currently used to mark concrete types as "permitted for reflection, aka downcasting"). This is a breaking change: it means that impls like ```rust impl<T> Error for MyErrorType<T> { ... } ``` must change to something like ```rust impl<T: Reflect> Error for MyErrorType<T> { ... } ``` except that `Reflect` is currently unstable (and should remain so for the time being). For now, code can instead bound by `Any`: ```rust impl<T: Any> Error for MyErrorType<T> { ... } ``` which *is* stable and has `Reflect` as a super trait. The downside is that this imposes a `'static` constraint, but that only constrains *when* `Error` is implemented -- it does not actually constrain the types that can implement `Error`. [breaking-change]
2015-04-28Register new snapshotsTamir Duberstein-5/+1
2015-04-27std: Prepare for linking to muslAlex Crichton-1/+3
This commit modifies the standard library and its dependencies to link correctly when built against MUSL. This primarily ensures that the right libraries are linked against and when they're linked against they're linked against statically.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-23Auto merge of #24695 - bluss:arc-default, r=alexcrichtonbors-1/+1
Relax bounds on Default implementation for Arc. Send + Sync are overly restrictive, follow other traits for Arc.
2015-04-22Relax bounds on Default implementation for Arc.Ulrik Sverdrup-1/+1
Send + Sync are overly restrictive, follow other traits for Arc.
2015-04-22Remove doc-comment default::Default importsCorey Farwell-1/+0
In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was added to the prelude, so these imports are no longer necessary.
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-2/+0
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-20Rollup merge of #24629 - steveklabnik:gh24511, r=alexcrichtonSteve Klabnik-8/+13
Without the `box` keyword, one of these two reasons is not correct, so let's just eliminate this section and elaborate on the reason for the legit use case inline. Fixes #24511
2015-04-20Rollup merge of #24625 - frewsxcv:patch-16, r=steveklabnikSteve Klabnik-1/+1
As far as I can tell, this conversion to integer to floating point does not need to happen and is beside the point
2015-04-20Clean up Box documentation.Steve Klabnik-8/+13
Without the `box` keyword, one of these two reasons is not correct, so let's just eliminate this section and elaborate on the reason for the legit use case inline. Fixes #24511
2015-04-20Simplify alloc::arc::Arc example in doc-commentCorey Farwell-1/+1
As far as I can tell, this conversion to integer to floating point does not need to happen and is beside the point
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-2/+0
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-16Suppress improper_ctypes warnings when compiling liballoc with external_featuresKrzysztof Drewniak-0/+1