Skip to content

Commit

Permalink
Explain reason for using deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
vks committed Feb 25, 2019
1 parent 240b0e8 commit 58aace9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rand_jitter/src/lib.rs
Expand Up @@ -77,7 +77,7 @@ use core::{fmt, mem, ptr};
#[cfg(feature = "std")]
use std::sync::atomic::{AtomicUsize, Ordering};
#[cfg(feature = "std")]
#[allow(deprecated)] // Since Rust 1.34, `Atomic*::new` is preferred.
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
use std::sync::atomic::ATOMIC_USIZE_INIT;

const MEMORY_BLOCKS: usize = 64;
Expand Down
2 changes: 1 addition & 1 deletion rand_os/src/netbsd.rs
Expand Up @@ -15,7 +15,7 @@ use super::OsRngImpl;
use std::fs::File;
use std::io::Read;
use std::sync::atomic::{AtomicBool, Ordering};
#[allow(deprecated)] // Since Rust 1.34, `Atomic*::new` is preferred.
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
use std::sync::atomic::ATOMIC_BOOL_INIT;

#[derive(Clone, Debug)]
Expand Down
4 changes: 2 additions & 2 deletions rand_os/src/solaris.rs
Expand Up @@ -29,7 +29,7 @@ use std::io::Read;
use std::fs::{File, OpenOptions};
use std::os::unix::fs::OpenOptionsExt;
use std::sync::atomic::{AtomicBool, Ordering};
#[allow(deprecated)] // Since Rust 1.34, `Atomic*::new` is preferred.
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
use std::sync::atomic::ATOMIC_BOOL_INIT;
use std::cmp;

Expand Down Expand Up @@ -155,7 +155,7 @@ fn getrandom_try_fill(dest: &mut [u8], blocking: bool) -> Result<(), Error> {

fn is_getrandom_available() -> bool {
use std::sync::atomic::{AtomicBool, Ordering};
#[allow(deprecated)] // Since Rust 1.34, `Atomic*::new` is preferred.
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
use std::sync::atomic::ATOMIC_BOOL_INIT;
use std::sync::{Once, ONCE_INIT};

Expand Down
2 changes: 1 addition & 1 deletion src/rngs/adapter/reseeding.rs
Expand Up @@ -287,7 +287,7 @@ mod fork {
extern crate libc;

use core::sync::atomic::{AtomicUsize, AtomicBool, Ordering};
#[allow(deprecated)] // Since Rust 1.34, `Atomic*::new` is preferred.
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
use core::sync::atomic::{ATOMIC_USIZE_INIT, ATOMIC_BOOL_INIT};

// Fork protection
Expand Down

0 comments on commit 58aace9

Please sign in to comment.