Skip to content

Commit 74e2391

Browse files
authored
Mount the lazy module only when neccecary (#509)
1 parent 387248f commit 74e2391

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/lazy.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//! Helpers built around pointer-sized atomics.
2-
#![cfg(target_has_atomic = "ptr")]
3-
#![allow(dead_code)]
42
use core::sync::atomic::{AtomicUsize, Ordering};
53

64
// This structure represents a lazily initialized static usize value. Useful

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ extern crate cfg_if;
248248
use core::mem::MaybeUninit;
249249

250250
mod error;
251-
mod lazy;
252251
mod util;
253252

254253
#[cfg(feature = "std")]
@@ -275,6 +274,8 @@ cfg_if! {
275274
} else if #[cfg(getrandom_backend = "rdrand")] {
276275
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
277276
compile_error!("`rdrand` backend can be enabled only for x86 and x86-64 targets!");
277+
278+
mod lazy;
278279
#[path = "rdrand.rs"] mod imp;
279280
} else if #[cfg(getrandom_backend = "wasm_js")] {
280281
#[cfg(not(all(
@@ -351,6 +352,7 @@ cfg_if! {
351352
),
352353
)
353354
))] {
355+
mod lazy;
354356
mod util_libc;
355357
mod use_file;
356358
mod linux_android;
@@ -387,6 +389,7 @@ cfg_if! {
387389
} else if #[cfg(windows)] {
388390
#[path = "windows.rs"] mod imp;
389391
} else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] {
392+
mod lazy;
390393
#[path = "rdrand.rs"] mod imp;
391394
} else if #[cfg(all(
392395
any(target_arch = "wasm32", target_arch = "wasm64"),

0 commit comments

Comments
 (0)