about summary refs log tree commit diff
path: root/src/libstd/rand.rs
AgeCommit message (Collapse)AuthorLines
2013-09-22std: move rand.rs to rand/mod.rs.Huon Wilson-1225/+0
2013-09-19Replace unreachable() calls with unreachable!().Chris Morgan-2/+1
This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-18Register new snapshotsAlex Crichton-1/+1
2013-09-15Use std::iter::range_stepblake2-ppc-15/+12
Use the iterator version instead of the old uint::/int::range_step functions.
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-2/+2
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-09-04stop treating char as an integer typeDaniel Micay-8/+1
Closes #7609
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-2/+0
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+6
2013-08-18auto merge of #8558 : kballard/rust/xorshift-seed, r=cmrbors-6/+15
Fixes #8359.
2013-08-16Give XorShiftRng::new() a random seedKevin Ballard-6/+15
Fixes #8359.
2013-08-16doc: correct spelling in documentation.Huon Wilson-1/+1
2013-08-15auto merge of #8491 : robertknight/rust/7722-reservoir_sampling, r=graydonbors-0/+56
Fixes #7722 I had a couple of queries: - Should this return an array or an iterator? - Should this be a method on iterators or on the rng? I implemented it in RngUtils as it seemed to belong with shuffle().
2013-08-13Add RngUtils::sample() method for reservoir sampling from iteratorsRobert Knight-0/+56
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-2/+2
Closes #5495
2013-08-07Add weak_rng to get a random algo that puts more emphasis on speed than securityJordi Boggiano-0/+10
2013-08-07Document rand module with more emphasis on cryptographic securityJordi Boggiano-2/+12
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-2/+2
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-03remove obsolete `foreach` keywordDaniel Micay-6/+6
this has been replaced by `for`
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-6/+9
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-6/+5
2013-08-02replace `range` with an external iteratorDaniel Micay-1/+2
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-3/+3
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-7/+6
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-11/+11
2013-07-22std: add #[bench] benchmarks for rand.Graydon Hoare-1/+35
2013-07-22new snapshotDaniel Micay-3/+0
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-7/+8
Place `pub` or `priv` on individual items instead.
2013-07-20auto merge of #7894 : pcwalton/rust/and-pointers-in-at-boxes, r=brsonbors-1/+1
r? @brson
2013-07-18librustc: Forbid `&` pointers (other than `&'static`) inside `@` boxes.Patrick Walton-1/+1
This makes custom borrowing implementations for custom smart pointers sound.
2013-07-18Fix warnings in libstd and librusti testsblake2-ppc-1/+0
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-6/+6
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-16/+17
2013-07-14Make TLS keys actually take up spaceAlex Crichton-1/+1
If the TLS key is 0-sized, then the linux linker is apparently smart enough to put everything at the same pointer. OSX on the other hand, will reserve some space for all of them. To get around this, the TLS key now actuall consumes space to ensure that it gets a unique pointer
2013-07-14Purge the last remnants of the old TLS apiAlex Crichton-9/+7
Closes #3273
2013-07-12Remove the global 'vec::to_owned' functionAlex Crichton-1/+1
2013-07-11auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwaltonbors-2/+2
cc #6004 and #3273 This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats: 1. Changing `local_set` to not require `@` is blocked on #7673 2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it... The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed. This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
2013-07-11Remove all external requirements of `@` from TLSAlex Crichton-1/+1
Closes #6004
2013-07-10Fixed exampleskorenchkin-19/+31
The examples were still using `core::` instead of `std::` All of the examples needed a `use std::rand;` at the top to compile Most of the examples had `rng = rand::rng();` instead of `let mut rng = rand::rng();`
2013-07-09Rename local_data methods/types for less keystrokesAlex Crichton-2/+2
2013-07-08 Replaces the free-standing functions in f32, &c.Jens Nockert-1/+2
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
2013-07-04Convert vec::{as_imm_buf, as_mut_buf} to methods.Huon Wilson-2/+2
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-5/+5
2013-06-30Convert vec::{reverse, swap} to methods.Huon Wilson-1/+1
2013-06-28Rewrite each_path to allow performance improvements in the future.Patrick Walton-0/+1
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.
2013-06-28librustc: Disallow "mut" from distributing over bindings.Patrick Walton-1/+2
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-26auto merge of #7216 : kballard/rust/task_rng, r=brsonbors-10/+6
2013-06-23vec: remove BaseIter implementationDaniel Micay-4/+5
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-20Make task_rng() return @mut R instead of @@mut RKevin Ballard-10/+6
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-3/+3
2013-06-16Add copies to type params with Copy boundNiko Matsakis-3/+3