Skip to content

Commit bac2448

Browse files
committed
Fix build errors on nightly (alloc crate changes)
1 parent 0faff20 commit bac2448

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/distributions/other.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl<T> Distribution<Wrapping<T>> for Standard where Standard: Distribution<T> {
180180
mod tests {
181181
use {Rng, RngCore, Standard};
182182
use distributions::Alphanumeric;
183-
#[cfg(all(not(feature="std"), feature="alloc"))] use alloc::String;
183+
#[cfg(all(not(feature="std"), feature="alloc"))] use alloc::string::String;
184184

185185
#[test]
186186
fn test_misc() {

src/distributions/weighted.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use ::core::cmp::PartialOrd;
1515
use ::{Error, ErrorKind};
1616

1717
// Note that this whole module is only imported if feature="alloc" is enabled.
18-
#[cfg(not(feature="std"))] use alloc::Vec;
18+
#[cfg(not(feature="std"))] use alloc::vec::Vec;
1919

2020
/// A distribution using weighted sampling to pick a discretely selected item.
2121
///

src/seq.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
#[cfg(feature="alloc")] use core::ops::Index;
1616

1717
#[cfg(feature="std")] use std::vec;
18-
#[cfg(all(feature="alloc", not(feature="std")))] use alloc::{vec, Vec};
18+
#[cfg(all(feature="alloc", not(feature="std")))] use alloc::vec;
19+
#[cfg(all(feature="alloc", not(feature="std")))] use alloc::vec::Vec;
1920
// BTreeMap is not as fast in tests, but better than nothing.
2021
#[cfg(feature="std")] use std::collections::HashMap;
21-
#[cfg(all(feature="alloc", not(feature="std")))] use alloc::btree_map::BTreeMap;
22+
#[cfg(all(feature="alloc", not(feature="std")))] use alloc::collections::BTreeMap;
2223

2324

2425
use super::Rng;
@@ -599,7 +600,7 @@ mod test {
599600
#[cfg(feature = "alloc")] use {Rng, SeedableRng};
600601
#[cfg(feature = "alloc")] use prng::XorShiftRng;
601602
#[cfg(all(feature="alloc", not(feature="std")))]
602-
use alloc::Vec;
603+
use alloc::vec::Vec;
603604

604605
#[test]
605606
fn test_slice_choose() {

0 commit comments

Comments
 (0)