about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-3488/+0
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-13auto merge of #12861 : huonw/rust/lint-owned-vecs, r=thestingerbors-0/+1
lint: add lint for use of a `~[T]`. This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-0/+1
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-5/+5
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-12Use generic impls for `Hash`Erick Tryzelaar-8/+8
2014-03-12rand: deprecate `rng`.Huon Wilson-3/+2
This should be called far less than it is because it does expensive OS interactions and seeding of the internal RNG, `task_rng` amortises this cost. The main problem is the name is so short and suggestive. The direct equivalent is `StdRng::new`, which does precisely the same thing. The deprecation will make migrating away from the function easier.
2014-03-12Update users for the std::rand -> librand move.Huon Wilson-4/+5
2014-03-07create a sensible comparison trait hierarchyDaniel Micay-1/+1
* `Ord` inherits from `Eq` * `TotalOrd` inherits from `TotalEq` * `TotalOrd` inherits from `Ord` * `TotalEq` inherits from `Eq` This is a partial implementation of #12517.
2014-03-06fix typos with with repeated words, just like this sentence.Kang Seonghoon-1/+1
2014-03-05stats: fix handling of NaN in `min` and `max`Daniel Micay-3/+11
The `cmp::min` and `cmp::max` functions are not correct with partially ordered values. #12712
2014-03-04doc: use the newer faviconAdrien Tétar-1/+1
2014-03-01Publicise types/add #[allow(visible_private_types)] to a variety of places.Huon Wilson-0/+1
There's a lot of these types in the compiler libraries, and a few of the older or private stdlib ones. Some types are obviously meant to be public, others not so much.
2014-02-24Remove std::from_str::FromStr from the preludeBrendan Zabarauskas-0/+1
2014-02-24auto merge of #12453 : alexcrichton/rust/move-json, r=brsonbors-2306/+2
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-24auto merge of #12445 : huonw/rust/less-unsafe, r=alexcrichtonbors-0/+16
Commits for details. Highlights: - `flate` returns `CVec<u8>` to save reallocating a whole new `&[u8]` - a lot of `transmute`s removed outright or replaced with `as` (etc.)
2014-02-24Move extra::json to libserializeAlex Crichton-2306/+2
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-24auto merge of #12412 : alexcrichton/rust/deriving-show, r=huonwbors-87/+78
This commit removes deriving(ToStr) in favor of deriving(Show), migrating all impls of ToStr to fmt::Show. Most of the details can be found in the first commit message. Closes #12477
2014-02-24Remove deriving(ToStr)Alex Crichton-9/+9
This has been superseded by deriving(Show). cc #9806
2014-02-23auto merge of #12380 : alexcrichton/rust/run-rewrite, r=brsonbors-5/+5
The std::run module is a relic from a standard library long since past, and there's not much use to having two modules to execute processes with where one is slightly more convenient. This commit merges the two modules, moving lots of functionality from std::run into std::io::process and then deleting std::run. New things you can find in std::io::process are: * Process::new() now only takes prog/args * Process::configure() takes a ProcessConfig * Process::status() is the same as run::process_status * Process::output() is the same as run::process_output * I/O for spawned tasks is now defaulted to captured in pipes instead of ignored * Process::kill() was added (plus an associated green/native implementation) * Process::wait_with_output() is the same as the old finish_with_output() * destroy() is now signal_exit() * force_destroy() is now signal_kill() Closes #2625 Closes #10016
2014-02-23Roll std::run into std::io::processAlex Crichton-5/+5
The std::run module is a relic from a standard library long since past, and there's not much use to having two modules to execute processes with where one is slightly more convenient. This commit merges the two modules, moving lots of functionality from std::run into std::io::process and then deleting std::run. New things you can find in std::io::process are: * Process::new() now only takes prog/args * Process::configure() takes a ProcessConfig * Process::status() is the same as run::process_status * Process::output() is the same as run::process_output * I/O for spawned tasks is now defaulted to captured in pipes instead of ignored * Process::kill() was added (plus an associated green/native implementation) * Process::wait_with_output() is the same as the old finish_with_output() * destroy() is now signal_exit() * force_destroy() is now signal_kill() Closes #2625 Closes #10016
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-87/+78
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-8/+8
2014-02-24flate: return CVec<u8> rather than copying into a new vector.Huon Wilson-0/+16
This trades an O(n) allocation + memcpy for a O(1) proc allocation (for the destructor). Most users only need &[u8] anyway (all of the users in the main repo), and so this offers large gains.
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-4/+4
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-22auto merge of #11863 : erickt/rust/hash, r=acrichtobors-0/+1
This PR merges `IterBytes` and `Hash` into a trait that allows for generic non-stream-based hashing. It makes use of @eddyb's default type parameter support in order to have a similar usage to the old `Hash` framework. Fixes #8038. Todo: - [x] Better documentation - [ ] Benchmark - [ ] Parameterize `HashMap` on a `Hasher`.
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-0/+1
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-21Move time out of extra (cc #8784)Arcterus-1477/+1
2014-02-21auto merge of #12415 : HeroesGrave/rust/move-enum-set, r=alexcrichtonbors-295/+0
Part of #8784 Also removed the one glob import.
2014-02-20Mass rename if_ok! to try!Alex Crichton-63/+63
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-20move extra::test to libtestLiigo Zhuang-1564/+3
2014-02-20move enum_set to libcollections. #8784HeroesGrave-295/+0
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-5/+8
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-19auto merge of #12389 : zr40/rust/fix-test-metric-typo, r=alexcrichtonbors-1/+1
2014-02-19auto merge of #12231 : wycats/rust/url_path_parse, r=alexcrichtonbors-0/+115
It is sometimes useful to parse just the path portion of a URL (path, query string and fragment) rather than the entire URL. In theory I could have made Url embed a Path, but that would be a breaking change and I assume that Servo uses this API. I would be happy to update the PR to embed Path in Url if that's what people wanted.
2014-02-19Fix typo in test metric ratchet stdout outputMatthijs van der Vleuten-1/+1
2014-02-18auto merge of #12361 : sfackler/rust/rustdoc-test-extern, r=alexcrichtonbors-0/+5
2014-02-18rustdoc: Only inject extern crates if not presentSteven Fackler-0/+5
2014-02-18auto merge of #12345 : huonw/rust/speeling, r=cmrbors-6/+6
2014-02-17auto merge of #12232 : kballard/rust/taskbuilder-is-a-builder, r=alexcrichtonbors-5/+4
Delete all the documentation from std::task that references linked failure. Tweak TaskBuilder to be more builder-like. `.name()` is now `.named()` and `.add_wrapper()` is now `.with_wrapper()`. Remove `.watched()` and `.unwatched()` as they didn't actually do anything. Closes #6399.
2014-02-18Spellcheck library docs.Huon Wilson-6/+6
2014-02-17Rename Bitwise::population_count to Bitwise::count_ones and add ↵Brendan Zabarauskas-1/+1
Bitwise::count_zeros These are inspired by the [functions in the Julia standard library](http://docs.julialang.org/en/release-0.2/stdlib/base/#Base.count_ones).
2014-02-16Update clients of the TaskBuilder APIKevin Ballard-5/+4
2014-02-15auto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfacklerbors-2/+2
It's too easy to forget the `rust` tag to test something. Closes #11698
2014-02-14Fix all code examplesAlex Crichton-2/+2
2014-02-14extern mod => extern crateAlex Crichton-11/+11
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Add function doc comments for extra::url::*Dave Hodder-15/+46
2014-02-14extra: Capture stdout/stderr of tests by defaultAlex Crichton-33/+52
When tests fail, their stdout and stderr is printed as part of the summary, but this helps suppress failure messages from #[should_fail] tests and generally clean up the output of the test runner.
2014-02-13Removed num::OrderableMichael Darakananda-4/+6
2014-02-13remove duplicate function from std::ptr (is_null, is_not_null, offset, ↵JeremyLetang-2/+2
mut_offset)
2014-02-13Register new snapshotsAlex Crichton-10/+0