about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2016-12-28Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]`Andrew Paseltiner-7/+5
CC #34761
2016-12-27Merge branch 'master' into escape-reason-docsEsteban Küber-47/+11
2016-12-26Remove extra lang item, exchange_free; use box_free instead.Mark Simulacrum-0/+1
Trans used to insert code equivalent to box_free in a wrapper around exchange_free, and that code is now removed from trans.
2016-12-24Add missing urls in Arc docsGuillaume Gomez-15/+17
2016-12-20Inline base::malloc_raw_dyn.Mark-Simulacrum-0/+1
Move comment about not unwinding into liballoc.
2016-12-16Address falloutAaron Turon-31/+2
2016-12-15Stabilize:Aaron Turon-16/+7
- `std::rc::Rc::{strong_count, weak_count}` - `std::sync::Arc::{strong_count, weak_count}` Deprecate: - `std::rc::Rc::{would_unwrap, is_unique}`
2016-12-12rustdoc: escape the deprecated and unstable reason textEsteban Küber-4/+4
2016-12-09Auto merge of #37492 - japaric:no-atomics-alloc, r=brsonbors-15/+36
make `alloc` and `collections` compilable for thumbv6m-none-eabi by cfging away `alloc::Arc` and changing OOM to abort for this target r? @alexcrichton cc @thejpster
2016-12-07Rollup merge of #38189 - GuillaumeGomez:rc_links, r=frewsxcvGuillaume Gomez-43/+45
Add missing links to Rc doc r? @frewsxcv
2016-12-07Auto merge of #38149 - bluss:is-empty, r=alexcrichtonbors-1/+9
Forward more ExactSizeIterator methods and `is_empty` edits - Forward ExactSizeIterator methods in more places, like `&mut I` and `Box<I>` iterator impls. - Improve `VecDeque::is_empty` itself (see commit 4) - All the collections iterators now have `len` or `is_empty` forwarded if doing so is a benefit. In the remaining cases, they already use a simple size hint (using something like a stored `usize` value), which is sufficient for the default implementation of len and is_empty.
2016-12-05Add missing links to Rc docGuillaume Gomez-43/+45
2016-12-04alloc: Forward ExactSizeIterator methods in Iterator for Box<I>Ulrik Sverdrup-1/+9
2016-12-02core: Remove Self: Sized from Iterator::nthUlrik Sverdrup-0/+3
It is an unnecessary restriction; nth neither needs self to be sized nor needs to be exempted from the trait object. It increases the utility of the nth method, because type specific implementations are available through `&mut I` or through an iterator trait object. It is a backwards compatible change due to the special cases of the `where Self: Sized` bound; it was already optional to include this bound in `Iterator` implementations.
2016-11-11[breaking-change] change the `box_free` item to accept pointers to unsized typesOliver 'ker' Schneider-4/+5
2016-11-10drop an unnecessary newlineJorge Aparicio-1/+0
2016-11-10use an 'imp' module to reduce the amount of cfgsJorge Aparicio-27/+32
2016-11-09Auto merge of #37657 - steveklabnik:rollup, r=steveklabnikbors-5/+11
Rollup of 8 pull requests - Successful merges: #35102, #37425, #37483, #37588, #37601, #37610, #37650, #37652 - Failed merges:
2016-11-08Auto merge of #37192 - cristicbz:rust-rc-into-raw, r=brsonbors-0/+190
Add `{into,from}_raw` to Rc and Arc These methods convert to and from a `*const T` for `Rc` and `Arc` similar to the way they work on `Box`. The only slight complication is that `from_raw` needs to offset the pointer back to find the beginning of the `RcBox`/`ArcInner`. I felt this is a fairly small addition, filling in a gap (when compared to `Box`) so it wouldn't need an RFC. The motivation is primarily for FFI. (I'll create an issue and update a PR with the issue number if reviewers agree with the change in principle **Edit: done #37197**) ~~Edit: This was initially `{into,from}_raw` but concerns were raised about the possible footgun if mixed with the methods of the same name of `Box`.~~ Edit: This was went from `{into,from}_raw` to `{into,from}_inner_raw` then back to `{into,from}_raw` during review.
2016-11-08More proeminent warning in Arc::{strong,weak}_count docs.Simon Sapin-5/+11
2016-11-06Add a comment to `Arc::MAX_REFCOUNT`Daan Sprenkels-0/+4
The constant name `MAX_REFCOUNT` suggests that the value is a _hard_ limit on the amount of references to an `Arc`. This is a more soft limit however. This commit adds a comment to the constant to annotate this. See also: PR #37605
2016-11-05Add `{into,from}_raw` to Rc and ArcCristi Cobzarenco-0/+190
2016-10-30make `alloc` and `collections` compilable for thumbv6m-none-eabiJorge Aparicio-0/+17
by cfging away `alloc::Arc` and changing OOM to abort for this target
2016-10-16run rustfmt on various foldersSrinivas Reddy Thatiparthy-11/+3
2016-10-13Add assert checking that allocation and deallocation sizes are equalVadim Petrochenkov-3/+4
2016-10-13Add an unstable constructor for creating `Rc<str>` from `str`Vadim Petrochenkov-1/+26
2016-10-04Apply some Arc doc changes to RcKeegan McAllister-11/+21
2016-10-04Update Arc docs to match new Rc docsKeegan McAllister-145/+281
2016-09-30Auto merge of #36339 - brson:emscripten-new, r=alexcrichtonbors-0/+1
Working asmjs and wasm targets This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman. It does a few things: - Updates LLVM with the emscripten [fastcomp](https://github.com/rust-lang/llvm/pull/50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets. - Teaches rustbuild to correctly link C code with emscripten - Updates gcc-rs to work correctly with emscripten - Teaches rustbuild to run crate tests for emscripten with node - Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode - Modifies libtest to run in single-threaded mode for emscripten - Ignores a host of tests that don't work yet, mostly dealing with threads and I/O - Updates libc with wasm32 definitions (presently the same as asmjs) - Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm Notes and caveats: - This is only known to work with `--enable-rustbuild`. - The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node https://github.com/kripken/emscripten/issues/4542, but hello.rs does seem to work when run on node via the binaryen interpreter - This requires an up to date installation of the emscripten sdk from its incoming branch - Unwinding is very broken - When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies. https://github.com/rust-lang/rust/issues/36317 tracks work on this. Fixes https://github.com/rust-lang/rust/issues/36515 Fixes https://github.com/rust-lang/rust/issues/36515 Fixes https://github.com/rust-lang/rust/issues/36356
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+1
2016-09-30Rollup merge of #36576 - GuillaumeGomez:box_urls, r=steveklabnikSteve Klabnik-2/+6
Add missing urls for Box doc r? @steveklabnik
2016-09-28Remove stage0 hacksBrian Anderson-6/+0
2016-09-21Tweak std::rc docsKeegan McAllister-160/+310
Fixes #29372.
2016-09-19Add missing urls for Box docGuillaume Gomez-2/+6
2016-09-15Add `pub fn ptr_eq(this: &Self, other: &Self) -> bool` to `Rc` and `Arc`.Simon Sapin-0/+74
Servo and Kuchiki have had helper functions doing this for some time.
2016-09-11Documentation for default types modifiedathulappadan-1/+1
2016-09-11Documentation of what does for each typeathulappadan-0/+4
2016-08-27Doc: explain why Box/Rc/Arc methods do not take selfGeorg Brandl-0/+16
This can be confusing for newcomers, especially due to the argument name "this".
2016-08-26Replace unnecessary uses of `TraitObject` with castsAndrew Paseltiner-8/+3
2016-08-24Remove drop flags from structs and enums implementing Drop.Eduard Burtescu-49/+21
2016-08-23Auto merge of #35656 - Stebalien:fused, r=alexcrichtonbors-1/+5
Implement 1581 (FusedIterator) * [ ] Implement on patterns. See https://github.com/rust-lang/rust/issues/27721#issuecomment-239638642. * [ ] Handle OS Iterators. A bunch of iterators (`Args`, `Env`, etc.) in libstd wrap platform specific iterators. The current ones all appear to be well-behaved but can we assume that future ones will be? * [ ] Does someone want to audit this? On first glance, all of the iterators on which I implemented `FusedIterator` appear to be well-behaved but there are a *lot* of them so a second pair of eyes would be nice. * I haven't touched rustc internal iterators (or the internal rand) because rustc doesn't actually call `fuse()`. * `FusedIterator` can't be implemented on `std::io::{Bytes, Chars}`. Closes: #35602 (Tracking Issue) Implements: rust-lang/rfcs#1581
2016-08-21add example for `Rc::would_unwrap`Matthew Piziak-0/+17
Part of #29372 r? @steveklabnik
2016-08-18Add a FusedIterator trait.Steven Allen-1/+5
This trait can be used to avoid the overhead of a fuse wrapper when an iterator is already well-behaved. Conforming to: RFC 1581 Closes: #35602
2016-08-14Fix a couple of typos in RawVecIvan Ukhov-3/+3
2016-07-22std: Ignore tests where threads outlive mainAlex Crichton-1/+6
Long ago we discovered that threads which outlive main and then exit while the rest of the program is exiting causes Windows to hang (#20704). That's what was happening in this test so let's just not run this test any more.
2016-07-15Rollup merge of #34733 - izgzhen:alloc-arc-doc-improve, r=steveklabnikGuillaume Gomez-43/+46
Improve arc doc, fixing #32905 As issue #32905 detailed, I moved part of the module doc to the struct doc, and fixed some small places in the `alloc::arc`.
2016-07-12Rollup merge of #34740 - GuillaumeGomez:boxed_doc, r=steveklabnikGuillaume Gomez-3/+46
Improve boxed docs Fixes #29343. r? @steveklabnik
2016-07-12Improve arc doc, fixing #32905Zhen Zhang-43/+46
2016-07-11Improve boxed docsGuillaume Gomez-3/+46
2016-07-08Rollup merge of #34097 - arbitrary-cat:master, r=steveklabnikManish Goregaokar-1/+2
Revise wording in Rc documentation. The term "thread-local" has a widely accepted meaning which is not the meaning it's used for here.