Skip to content

Commit 0516c40

Browse files
committed
std: Reexport some unstable rand functionality for now
Needed to get modules like rustc_back::tempdir compiling.
1 parent 359ab0b commit 0516c40

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/librustc_back/tempdir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::env;
1212
use std::io::{self, Error, ErrorKind};
1313
use std::fs;
1414
use std::path::{self, PathBuf, Path};
15-
use std::rand::{thread_rng, Rng};
15+
use std::__rand::{thread_rng, Rng};
1616

1717
/// A wrapper for a path to temporary directory implementing automatic
1818
/// scope-based deletion.

src/libstd/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,17 @@ pub mod rt;
280280
mod panicking;
281281
mod rand;
282282

283+
// Some external utilities of the standard library rely on randomness (aka
284+
// rustc_back::TempDir and tests) and need a way to get at the OS rng we've got
285+
// here. This module is not at all intended for stabilization as-is, however,
286+
// but it may be stabilized long-term. As a result we're exposing a hidden,
287+
// unstable module so we can get our build working.
288+
#[doc(hidden)]
289+
#[unstable(feature = "rand")]
290+
pub mod __rand {
291+
pub use rand::{thread_rng, Rng};
292+
}
293+
283294
// Modules that exist purely to document + host impl docs for primitive types
284295

285296
mod array;

0 commit comments

Comments
 (0)