From 2e6dded50f4c6170c82e2ba34a0789c78eb55190 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 8 Mar 2018 15:35:21 +0000 Subject: [PATCH] Fix alloc feature in rand-core --- Cargo.toml | 2 +- rand-core/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 073f6edcd99..8149c0287dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ default = ["std"] nightly = ["i128_support"] # enables all features requiring nightly rust std = ["rand-core/std", "winapi", "libc"] # default feature; without this rand uses libcore -alloc = [] # enables Vec and Box support without std +alloc = ["rand-core/alloc"] # enables Vec and Box support without std i128_support = [] # enables i128 and u128 support diff --git a/rand-core/src/lib.rs b/rand-core/src/lib.rs index ac2e84bb025..b6794081683 100644 --- a/rand-core/src/lib.rs +++ b/rand-core/src/lib.rs @@ -34,6 +34,7 @@ #![deny(missing_debug_implementations)] #![cfg_attr(not(feature="std"), no_std)] +#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))] #[cfg(feature="std")] extern crate core; #[cfg(all(feature = "alloc", not(feature="std")))] extern crate alloc;