about summary refs log tree commit diff
path: root/src/librand
AgeCommit message (Collapse)AuthorLines
2014-04-03auto merge of #13286 : alexcrichton/rust/release, r=brsonbors-1/+1
Merging the 0.10 release into the master branch.
2014-04-02Fix fallout of requiring uint indicesAlex Crichton-4/+4
2014-04-02rand: replace Rng.shuffle's functionality with .shuffle_mut.Huon Wilson-25/+29
Deprecates the `shuffle_mut` name in favour of `shuffle` too. In future there will be many different types of owned vectors/vector-likes (e.g. DST's ~[], Vec, SmallVec, Rope, ...), and so privileging just `Vec` with the "functional" `shuffle` method is silly.
2014-04-02rand: remove (almost) all ~[]'s from Vec.Huon Wilson-86/+84
There are a few instances of them in tests which are using functions from std etc. that still are using ~[].
2014-04-01auto merge of #13225 : thestinger/rust/num, r=cmrbors-4/+3
The `Float` trait methods will be usable as functions via UFCS, and we came to a consensus to remove duplicate functions like this a long time ago. It does still make sense to keep the duplicate functions when the trait methods are static, unless the decision to leave out the in-scope trait name resolution for static methods changes.
2014-04-01auto merge of #13115 : huonw/rust/rand-errors, r=alexcrichtonbors-50/+80
move errno -> IoError converter into std, bubble up OSRng errors Also adds a general errno -> `~str` converter to `std::os`, and makes the failure messages for the things using `OSRng` (e.g. (transitively) the task-local RNG, meaning hashmap initialisation failures aren't such a black box).
2014-04-01rand: bubble up IO messages futher.Huon Wilson-50/+70
The various ...Rng::new() methods can hit IO errors from the OSRng they use, and it seems sensible to expose them at a higher level. Unfortunately, writing e.g. `StdRng::new().unwrap()` gives a much poorer error message than if it failed internally, but this is a problem with all `IoResult`s.
2014-04-01rand: bubble up IO errors when creating an OSRng.Huon Wilson-13/+23
2014-03-31Switch some tuple structs to pub fieldsAlex Crichton-4/+4
This commit deals with the fallout of the previous change by making tuples structs have public fields where necessary (now that the fields are private by default).
2014-03-31rand: Switch field privacy as necessaryAlex Crichton-43/+45
2014-03-31num: rm wrapping of `Float` methods as functionsDaniel Micay-4/+3
The `Float` trait methods will be usable as functions via UFCS, and we came to a consensus to remove duplicate functions like this a long time ago. It does still make sense to keep the duplicate functions when the trait methods are static, unless the decision to leave out the in-scope trait name resolution for static methods changes.
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-9/+9
Closes #2569
2014-03-24auto merge of #13049 : alexcrichton/rust/io-fill, r=huonwbors-4/+2
This method can be used to fill a byte slice of data entirely, and it's considered an error if any error happens before its entirely filled.
2014-03-23auto merge of #13099 : FlaPer87/rust/master, r=huonwbors-1/+0
2014-03-23Register new snapshotsFlavio Percoco-1/+0
2014-03-23iter: remove `to_owned_vec`Daniel Micay-1/+1
This needs to be removed as part of removing `~[T]`. Partial type hints are now allowed, and will remove the need to add a version of this method for `Vec<T>`. For now, this involves a few workarounds for partial type hints not completely working.
2014-03-22rand: Use fill() instead of read()Alex Crichton-4/+2
It's possible for a reader to have a short read, and there's no reason the task should fail in this scenario. By using fill(), this has a stronger guarantee that the buffer will get filled with data.
2014-03-21rand: Fix a bug acquiring a context on windowsAlex Crichton-1/+39
The details can be found in the comment I wrote on the block in question, but the gist of it is that our usage of the TIB for a stack limit was causing CryptAcquireContext to fail, so we temporarily get around it by setting the stack limit to 0.
2014-03-21rand: Rewrite OsRng in Rust for windowsAlex Crichton-96/+112
This removes even more rust_builtin.c code, and allows us to more gracefully handle errors (not a process panic, but a task failure).
2014-03-20Register new snapshotsAlex Crichton-0/+1
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec -> std::sliceDaniel Micay-11/+11
Closes #12702
2014-03-15Test fixes and rebase conflictsAlex Crichton-1/+4
This commit switches over the backtrace infrastructure from piggy-backing off the RUST_LOG environment variable to using the RUST_BACKTRACE environment variable (logging is now disabled in libstd).
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-6/+6
* 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-12rand: deprecate `rng`.Huon Wilson-5/+18
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-12std: Move rand to librand.Huon Wilson-0/+3847
This functionality is not super-core and so doesn't need to be included in std. It's possible that std may need rand (it does a little bit now, for io::test) in which case the functionality required could be moved to a secret hidden module and reexposed by librand. Unfortunately, using #[deprecated] here is hard: there's too much to mock to make it feasible, since we have to ensure that programs still typecheck to reach the linting phase.