about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2015-03-17Rollup merge of #23329 - jbcrail:rm-syntax-highlight, r=sanxiynManish Goregaokar-2/+2
As suggested by @steveklabnik in #23254, I removed the redundant Rust syntax highlighting from the documentation.
2015-03-16remove importsJorge Aparicio-1/+0
2015-03-16impl<T> *const T, impl<T> *mut TJorge Aparicio-0/+4
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-2/+2
2015-03-13Add an "allocator" attribute to mark functions as allocatorsBjörn Steinbrink-0/+2
When this attribute is applied to a function, its return value gets the noalias attribute, which is how you tell LLVM that the function returns a "new" pointer that doesn't alias anything accessible to the caller, i.e. it acts like a memory allocator. Plain malloc doesn't need this attribute because LLVM already knows about malloc and adds the attribute itself.
2015-03-11Example -> ExamplesSteve Klabnik-4/+4
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-08Remove unneeded `T: Send + Sync` bounds from `Arc`.Huon Wilson-5/+5
The requirement `T: Send + Sync` only matters if the `Arc` crosses thread boundaries, and that is adequately controlled by the impls of `Send`/`Sync` for `Arc` itself. If `T` doesn't satisfy the bounds, then the `Arc` cannot cross thread boundaries and so everything is still safe (`Arc` just acts like an expensive `Rc`).
2015-03-06Rollup merge of #23056 - awlnx:master, r=nrcManish Goregaokar-0/+2
2015-03-05fix for new attributes failing. issue #22964awlnx-0/+2
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-3/+3
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-0/+1
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-04Auto merge of #22920 - tshepang:remove-some-warnings, r=huonwbors-1/+0
2015-03-03Switched to Box::new in many places.Felix S. Klock II-1/+1
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-03-03inline `Box::new` always.Felix S. Klock II-0/+1
(You shouldn't use it, but it is a semi-reasonable way to annotate types when necessary.)
2015-03-03Add `: Box<_>` or `::Box<_>` type annotations to various places.Felix S. Klock II-3/+13
This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-03-01remove some compiler warningsTshepang Lekhonkhobe-1/+0
2015-02-28std: Implement stdio for `std::io`Alex Crichton-10/+13
This is an implementation of RFC 899 and adds stdio functionality to the new `std::io` module. Details of the API can be found on the RFC, but from a high level: * `io::{stdin, stdout, stderr}` constructors are now available. There are also `*_raw` variants for unbuffered and unlocked access. * All handles are globally shared (excluding raw variants). * The stderr handle is no longer buffered. * All handles can be explicitly locked (excluding the raw variants). The `print!` and `println!` machinery has not yet been hooked up to these streams just yet. The `std::fmt::output` module has also not yet been implemented as part of this commit.
2015-02-27Rollup merge of #22843 - vhbit:no-jemalloc-fix, r=alexcrichtonManish Goregaokar-1/+1
"body": null,
2015-02-27Auto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearthbors-0/+7
Implements `Debug` for `RwLock` and `arc::Weak` in the same way it is implemented for `rc::Weak` (basically copy & paste). The lack of this implementation prevents the automatic implementation of `Debug` for structs containing members of these types.
2015-02-26Fixed build with jemalloc disabledValerii Hiora-1/+1
2015-02-26Implement `Debug` for `RwLock`, `arc::Weak` and `Mutex`nwin-0/+7
2015-02-24std: Stabilize some `ptr` functionsAlex Crichton-0/+1
Specifically, the following actions were taken: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. * All type parameters now are `T: ?Sized` wherever possible and new clauses were added to the `offset` functions to require that the type is sized. [breaking-change]
2015-02-23import boxed for alloc/rc.rs (fixup #22696)Manish Goregaokar-1/+3
2015-02-23Use boxed functions instead of transmuteStepan Koltsov-4/+6
... to convert between Box and raw pointers. E. g. use ``` let b: Box<Foo> = Box::from_raw(p); ``` instead of ``` let b: Box<Foo> = mem::transmute(p); ``` Patch also changes closure release code in `src/libstd/sys/unix/thread.rs` when `pthread_create` failed. Raw pointer was transmuted to box of `FnOnce()` instead of `Thunk`. This code was probably never executed, because `pthread_create` rarely fails in practice.
2015-02-23boxed: mark from_raw and into_raw functions inlineStepan Koltsov-0/+2
2015-02-23boxed: fix typo in docStepan Koltsov-3/+3
2015-02-22Rollup merge of #22584 - alexcrichton:snapshots, r=GankroManish Goregaokar-23/+0
2015-02-20Register new snapshotsAlex Crichton-23/+0
2015-02-20try to reduce bajillion warningsAlexis-0/+1
2015-02-18rollup merge of #22210: aturon/stab-final-borrowAlex Crichton-14/+0
Conflicts: src/libcollections/btree/map.rs src/libcollections/str.rs src/libcollections/vec.rs src/libcore/borrow.rs src/libcore/hash/mod.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs
2015-02-18Stabilize std::borrowAaron Turon-14/+0
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-11/+35
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-17Register new snapshotsAlex Crichton-14/+2
2015-02-17rollup merge of #22435: aturon/final-stab-threadAlex Crichton-8/+8
Conflicts: src/test/bench/rt-messaging-ping-pong.rs src/test/bench/rt-parfib.rs src/test/bench/task-perf-spawnalot.rs
2015-02-17Fallout from stabilizationAaron Turon-8/+8
2015-02-17Rc itself isn't immutable.Artem-1/+1
An "immutable reference-counted pointer" is confusing, one might think that the `Rc` itself is immutable which isn't the case.
2015-02-11Feature-gate the `#[unsafe_no_drop_flag]` attribute.Felix S. Klock II-0/+1
See RFC 320, "Non-zeroing dynamic drops." Fix #22173 [breaking-change]
2015-02-09int/uint => isize/usize in liblibc/liballoc/libarenawe-62/+62
2015-02-08Auto merge of #22044 - caspark:fix-rc-doc-links, r=nikomatsakisbors-2/+2
Current link structure is /std/rc/struct.Rc.html so ../index.html ends up linking to /std/ rather than /std/rc/
2015-02-07Feature-gate #![no_std]Keegan McAllister-0/+1
Fixes #21833. [breaking-change]
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-1/+2
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Fix broken link to std::rc module docsCaspar Krieger-2/+2
Current link structure is /std/rc/struct.Rc.html so ../index.html ends up linking to /std/ rather than /std/rc/
2015-02-06Rollup merge of #21966 - scialex:fix-extern, r=alexcrichtonManish Goregaokar-1/+3
Also added test for it. Fixes #21928
2015-02-06Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnikManish Goregaokar-4/+4
The spelling corrections were made in both documentation comments and regular comments.
2015-02-05Auto merge of #21894 - dotdash:assume_rc, r=alexcrichtonbors-2/+25
This is half of what @Aatch implemented in #21418. The non-null assumption is later canonicalized to !nonnull metadata and doesn't cause any slowdowns (in fact the build is slightly faster with this change). I left out the other half of #21418 because that still causes a ~16% increase in compile times (30m -> 35m).
2015-02-05Made external_crates feature work again.Alexander Light-1/+3
Also added test for it. Fixes #21928
2015-02-04Fix for misspelled comments.Joseph Crail-4/+4
The spelling corrections were made in both documentation comments and regular comments.
2015-02-03std: Remove `iter::ByRef` and generalize implsAlex Crichton-17/+15
This removes the `ByRef` iterator adaptor to stay in line with the changes to `std::io`. The `by_ref` method instead just returns `&mut Self`. This also removes the implementation of `Iterator for &mut Iterator` and instead generalizes it to `Iterator for &mut I` where `I: Iterator + ?Sized`. The `Box<I>` implementations were also updated. This is a breaking change due to the removal of the `std::iter::ByRef` type. All mentions of `ByRef<'a, T>` should be replaced with `&mut T` to migrate forward. [breaking-change]
2015-02-03Rc: Add assumptions that the pointer is non-nullJames Miller-2/+25
Since the snapshot compiler is still using an older LLVM version, omit the call in stage0, because compile times explode otherwise.
2015-02-02Auto merge of #21647 - alfie:suffix-medium, r=alexcrichtonbors-32/+32