From 0516c4099e68cfce267562c4460dc9a47be6776e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 9 Apr 2015 18:04:42 -0700 Subject: [PATCH] std: Reexport some unstable rand functionality for now Needed to get modules like rustc_back::tempdir compiling. --- src/librustc_back/tempdir.rs | 2 +- src/libstd/lib.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/librustc_back/tempdir.rs b/src/librustc_back/tempdir.rs index b12732f8794..522d66cb563 100644 --- a/src/librustc_back/tempdir.rs +++ b/src/librustc_back/tempdir.rs @@ -12,7 +12,7 @@ use std::env; use std::io::{self, Error, ErrorKind}; use std::fs; use std::path::{self, PathBuf, Path}; -use std::rand::{thread_rng, Rng}; +use std::__rand::{thread_rng, Rng}; /// A wrapper for a path to temporary directory implementing automatic /// scope-based deletion. diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 23776ecbc6e..d613fbe4d42 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -280,6 +280,17 @@ pub mod rt; mod panicking; mod rand; +// Some external utilities of the standard library rely on randomness (aka +// rustc_back::TempDir and tests) and need a way to get at the OS rng we've got +// here. This module is not at all intended for stabilization as-is, however, +// but it may be stabilized long-term. As a result we're exposing a hidden, +// unstable module so we can get our build working. +#[doc(hidden)] +#[unstable(feature = "rand")] +pub mod __rand { + pub use rand::{thread_rng, Rng}; +} + // Modules that exist purely to document + host impl docs for primitive types mod array;