diff options
| author | bors <bors@rust-lang.org> | 2015-03-03 14:18:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-03 14:18:03 +0000 |
| commit | 14f0942a49b77f81d0bedb3d8b5fb615ef521bb3 (patch) | |
| tree | fa3cabf0f4e563a1b4f9e40fafa4855e905fd8e7 /src/libstd/rand | |
| parent | 38e97b99a6b133cb4c621c68e75b28abc6c617c1 (diff) | |
| parent | 243c5164ea32b38c4ac44fdd5e0ceb2da45c283f (diff) | |
| download | rust-14f0942a49b77f81d0bedb3d8b5fb615ef521bb3.tar.gz rust-14f0942a49b77f81d0bedb3d8b5fb615ef521bb3.zip | |
Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddyb
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
Diffstat (limited to 'src/libstd/rand')
| -rw-r--r-- | src/libstd/rand/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 7fe20c37c6c..a49db012882 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -386,8 +386,8 @@ impl Rng for ThreadRng { /// ``` /// use std::rand; /// -/// let x = rand::random(); -/// println!("{}", 2u8 * x); +/// let x: u8 = rand::random(); +/// println!("{}", 2 * x as u16); /// /// let y = rand::random::<f64>(); /// println!("{}", y); |
