about summary refs log tree commit diff
path: root/src/libstd/rand/mod.rs
AgeCommit message (Collapse)AuthorLines
2015-12-18Use the getentropy(2) syscall on OpenBSDMichael McConville-0/+1
Rust already supports Linux's getrandom(2), which is very similar and was based on getentropy(2). This is a pretty clean, simple addition that uses the same approach as the iOS randomness API support.
2015-08-15std: Add issues to all unstable featuresAlex Crichton-1/+1
2015-08-11Register new snapshotsAlex Crichton-3/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-03syntax: Implement #![no_core]Alex Crichton-0/+1
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-05-28remove references to IoResultSteve Klabnik-1/+1
This is now std::io::Result
2015-04-14rand: Delete all doc testsAlex Crichton-168/+0
None of these actually compile any more!
2015-04-14test: Fixup many library unit testsAlex Crichton-258/+0
2015-04-14std: Remove old_io/old_path/rand modulesAlex Crichton-105/+7
This commit entirely removes the old I/O, path, and rand modules. All functionality has been deprecated and unstable for quite some time now!
2015-03-28Remove IteratorExtSteven Fackler-1/+1
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-24/+24
Now that support has been removed, all lingering use cases are renamed.
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+7
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-1/+1
2015-03-11Example -> ExamplesSteve Klabnik-1/+1
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-2/+2
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-1/+1
2015-03-03Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddybbors-2/+2
Rebase and follow-through on work done by @cmr and @aatch. Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed. The checks for division, remainder and bit-shifting have not been implemented yet. See also PR #20795 cc @Aatch ; cc @nikomatsakis
2015-03-03Accommodate arith-overflow in `rand` and `std::rand`.Felix S. Klock II-2/+2
Regarding the `rand` changes: It is unfortunate that Wrapping(T) does not support the `+=` operator. We may want to try to fix that before 1.0 to make porting code like this palatable. Regarding `std::rand`, just arith-overflow in first example from `std::rand::random()` doc.
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-5/+4
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-5/+5
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-5/+5
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-1/+1
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-5/+5
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-0/+3
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-0/+3
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-1/+1
2015-01-30Remove all `i` suffixesTobias Bucher-14/+14
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-8/+8
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-2/+2
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-28Merge remote-tracking branch 'origin/master' into rollupManish Goregaokar-1/+1
Conflicts: src/libcollections/slice.rs src/libcore/nonzero.rs src/libcore/ops.rs
2015-01-28Rollup merge of #21676 - Victory:fix-deprication-in-random, r=alexcrichtonManish Goregaokar-27/+27
Cleanup mention of uint, use usize/us instead. This includes the example `println!("{}", 2u * x);`
2015-01-27Merge remote-tracking branch 'rust-lang/master'Brian Anderson-1/+1
Conflicts: src/libcore/cell.rs src/librustc_driver/test.rs src/libstd/old_io/net/tcp.rs src/libstd/old_io/process.rs
2015-01-26Don't use if we can avoid itVictory-20/+20
2015-01-26cleanup depricated `uint` in rand mod and rand osVictory-27/+27
2015-01-26Fallout of io => old_ioAlex Crichton-1/+1
2015-01-23Set unstable feature names appropriatelyBrian Anderson-1/+1
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-1/+1
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-1/+1
2015-01-17Register new snapshots.Eduard Burtescu-2/+2
2015-01-12Add note about TLS lookups in random()Steve Klabnik-1/+26
Fixes #16072
2015-01-08Improvements to feature stagingBrian Anderson-1/+1
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
2015-01-07Test fixes and rebase conflictsAlex Crichton-1/+1
2015-01-08Rename `target_word_size` to `target_pointer_width`Nick Cameron-2/+2
Closes #20421 [breaking-change]
2015-01-06More test fixesAlex Crichton-1/+1
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-2/+2
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-05More test fixes!Alex Crichton-2/+2
2015-01-05Implement Clone for PRNGsSimonas Kazlauskas-1/+2
2015-01-03Remove deprecated functionalityAlex Crichton-2/+2
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2015-01-03std: fix falloutJorge Aparicio-1/+1