about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-12-18Disable capture_stderr test for nowAaron Turon-1/+1
2014-12-18Fallout from new thread APIAaron Turon-402/+277
2014-12-18Revise rt::unwindAaron Turon-46/+30
2014-12-18Remove rt::{mutex, exclusive}Aaron Turon-66/+73
2014-12-18Add blocking support module for channelsAaron Turon-308/+357
2014-12-18Remove rt::{local, local_data, thread_local_storage}Aaron Turon-524/+176
2014-12-18Introduce std::threadAaron Turon-720/+742
Also removes: * `std::task` * `std::rt::task` * `std::rt::thread` Notes for the new API are in a follow-up commit. Closes #18000
2014-12-18Remove rt::bookkeepingAaron Turon-72/+1
This commit removes the runtime bookkeeping previously used to ensure that all Rust tasks were joined before the runtime was shut down. This functionality will be replaced by an RAII style `Thread` API, that will also offer a detached mode. Since this changes the semantics of shutdown, it is a: [breaking-change]
2014-12-18Make at_exit initialize lazilyAaron Turon-21/+23
2014-12-18Allow args to work without rt initializationAaron Turon-18/+10
2014-12-18Refactor std::os to use sys::osAaron Turon-387/+352
2014-12-18libs: merge librustrt into libstdAaron Turon-1043/+6306
This commit merges the `rustrt` crate into `std`, undoing part of the facade. This merger continues the paring down of the runtime system. Code relying on the public API of `rustrt` will break; some of this API is now available through `std::rt`, but is likely to change and/or be removed very soon. [breaking-change]
2014-12-19auto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakisbors-0/+25
- The following operator traits now take their argument by value: `Neg`, `Not`. This breaks all existing implementations of these traits. - The unary operation `OP a` now "desugars" to `OpTrait::op_method(a)` and consumes its argument. [breaking-change] --- r? @nikomatsakis This PR is very similar to the binops-by-value PR cc @aturon
2014-12-18[collections] Adds `drain`: a way to sneak out the elements while clearing.Clark Gaebel-10/+157
It is useful to move all the elements out of some collections without deallocating the underlying buffer. It came up in IRC, and this patch implements it as `drain`. This has been discussed as part of RFC 509. r? @Gankro cc: @frankmcsherry
2014-12-18std: Remove public bool,tuple,unit modulesAlex Crichton-8/+135
This commit modifies rustdoc to not require these empty modules to be public in the standard library. The modules still remain as a location to attach documentation to, but the modules themselves are now private (don't have to commit to an API). The documentation for the standard library now shows all of the primitive types on the main index page.
2014-12-18remove TreeMap, TreeSet, TrieMap, TrieSet, LruCache. deprecate EnumSet's std ↵Alexis Beingessner-497/+13
re-export
2014-12-18libstd: convert `Duration` unops to by valueJorge Aparicio-0/+14
2014-12-18libstd: convert `BitFlags` unops to by valueJorge Aparicio-0/+11
2014-12-18auto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichtonbors-463/+472
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change] --- Rebased version of #18958 r? @alexcrichton cc @pcwalton
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-463/+472
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-18auto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichtonbors-8/+25
Windows dbghelp strips leading underscores from symbols, and I could not find a way to turn this off. So let's accept "ZN...E" form too. Also, print PC displacement from symbols. This is helpful in gauging whether the PC was indeed within the function displayed in the backtrace, or whether it just happened to be the closest public symbol in the module.
2014-12-18iOS: fallout of `marker::NoCopy` removalValerii Hiora-1/+0
2014-12-17rollup merge of #19935: cgaebel/hashmap-tuple-indexingAlex Crichton-88/+41
r? @Gankro @pczarn
2014-12-17rollup merge of #19902: alexcrichton/second-pass-memAlex Crichton-0/+8
This commit stabilizes the `mem` and `default` modules of std.
2014-12-17rollup merge of #19873: drewm1980/masterAlex Crichton-11/+11
In US english, "that" is used in restrictive clauses in place of "which", and often affects the meaning of sentences. In UK english and many dialects, no distinction is made. While Rust devs want to avoid unproductive pedanticism, it is worth at least being uniform in documentation such as: http://doc.rust-lang.org/std/iter/index.html and also in cases where correct usage of US english clarifies the sentence.
2014-12-17rollup merge of #19869: sfackler/free-stdinAlex Crichton-0/+7
r? @aturon
2014-12-17rollup merge of #19868: sourcefrog/masterAlex Crichton-3/+6
The rendered form in http://doc.rust-lang.org/nightly/std/rand/struct.OsRng.html looks wrong.
2014-12-17rollup merge of #19859: alexcrichton/flaky-testAlex Crichton-1/+2
This test would read with a timeout and then send a UDP message, expecting the message to be received. The receiving port, however, was bound in the child thread so it could be the case that the timeout and send happens before the child thread runs. To remedy this we just bind the port before the child thread runs, moving it into the child later on. cc #19120
2014-12-17rollup merge of #19832: japaric/no-nocopyAlex Crichton-14/+6
r? @aturon / @alexcrichton
2014-12-17rollup merge of #19770: csouth3/iterator-wrapperstructsAlex Crichton-57/+89
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This PR changes the iterators of `BTreeMap`, `BTreeSet`, `HashMap`, and `HashSet` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
2014-12-17auto merge of #19800 : sfackler/rust/core-hash, r=alexcrichtonbors-1/+1
r? @alexcrichton
2014-12-17Replaced wrapper functions with no_run and as_str().unwrap() with display()elszben-6/+3
2014-12-16Fix typoVadim Chugunov-1/+1
2014-12-17auto merge of #19761 : nick29581/rust/coerce-double, r=nikomatsakisbors-5/+5
Part of #18469 [breaking-change] A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form). r? @nikomatsakis (or anyone else, really)
2014-12-16Small cleanups in HashMap based off of new rust features.Clark Gaebel-88/+41
2014-12-16Added example to TempDirelszben-0/+53
2014-12-16auto merge of #19647 : nielsegberts/rust/master, r=pnkfelixbors-6/+6
The names expected and actual are not used anymore in the output. It also removes the confusion that the argument order is the opposite of junit. Bug #7330 is relevant.
2014-12-16auto merge of #19777 : nikomatsakis/rust/warn-on-shadowing, r=acrichtobors-5/+5
per rfc 459 cc https://github.com/rust-lang/rust/issues/19390 One question is: should we start by warning, and only switch to hard error later? I think we discussed something like this in the meeting. r? @alexcrichton
2014-12-15Move hash module from collections to coreSteven Fackler-1/+1
2014-12-16Remove the double auto-ref on arrays/strings as receiversNick Cameron-5/+5
Part of #18469 [breaking-change] A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form).
2014-12-15std: Second pass stabilization of `default`Alex Crichton-0/+8
This commit performs a second pass stabilization of the `std::default` module. The module was already marked `#[stable]`, and the inheritance of `#[stable]` was removed since this attribute was applied. This commit adds the `#[stable]` attribute to the trait definition and one method name, along with all implementations found in the standard distribution.
2014-12-16auto merge of #19747 : alexcrichton/rust/slice-one-trait, r=brsonbors-46/+37
This commit collapses the various prelude traits for slices into just one trait: * SlicePrelude/SliceAllocPrelude => SliceExt * CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt * OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt * PartialEqSlicePrelude => PartialEqSliceExt
2014-12-15Use wrapper structs for `HashSet`'s iterators.Chase Southwood-20/+59
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This commit changes the iterators of `HashSet` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
2014-12-15Use wrapper structs for `HashMap`'s iterators.Chase Southwood-38/+31
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This commit changes the keys and values iterators of `HashMap` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
2014-12-15auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakisbors-11/+121
- The following operator traits now take their arguments by value: `Add`, `Sub`, `Mul`, `Div`, `Rem`, `BitAnd`, `BitOr`, `BitXor`, `Shl`, `Shr`. This breaks all existing implementations of these traits. - The binary operation `a OP b` now "desugars" to `OpTrait::op_method(a, b)` and consumes both arguments. - `String` and `Vec` addition have been changed to reuse the LHS owned value, and to avoid internal cloning. Only the following asymmetric operations are available: `String + &str` and `Vec<T> + &[T]`, which are now a short-hand for the "append" operation. [breaking-change] --- This passes `make check` locally. I haven't touch the unary operators in this PR, but converting them to by value should be very similar to this PR. I can work on them after this gets the thumbs up. @nikomatsakis r? the compiler changes @aturon r? the library changes. I think the only controversial bit is the semantic change of the `Vec`/`String` `Add` implementation. cc #19148
2014-12-15libstd: add a dummy field to `OsRng` to avoid out of module constructionJorge Aparicio-2/+5
2014-12-15Remove internal uses of `marker::NoCopy`Jorge Aparicio-16/+5
2014-12-15Remove all shadowed lifetimes.Niko Matsakis-5/+5
2014-12-15rollup merge of #19787: akiss77/fix-i8-c_charBrian Anderson-1/+1
On AArch64, libc::c_char is u8. There are some places in the code where i8 is assumed, which causes compilation errors. (AArch64 is not officially supported yet, but this change does not hurt any other targets and makes the code future-proof.)
2014-12-15rollup merge of #19710: steveklabnik/gh15449Brian Anderson-7/+7
Fixes #15499.