about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-03-25 16:13:11 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-04-01 20:46:10 +1100
commitbc7a2d72a3fea324fa432de9b6ce6073302d3d8c (patch)
tree5291b4abea25c42302facd2cf2387003060ae376 /src/libstd/rt
parent0e8c949786539375ccb6ebe4af968c7cf5cebe43 (diff)
downloadrust-bc7a2d72a3fea324fa432de9b6ce6073302d3d8c.tar.gz
rust-bc7a2d72a3fea324fa432de9b6ce6073302d3d8c.zip
rand: bubble up IO messages futher.
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.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/task.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index ededc69c5a1..abaa91b12f8 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -434,7 +434,7 @@ mod test {
     #[test]
     fn rng() {
         use rand::{StdRng, Rng};
-        let mut r = StdRng::new();
+        let mut r = StdRng::new().unwrap();
         let _ = r.next_u32();
     }