Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount the lazy module only when neccecary #509

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/lazy.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! Helpers built around pointer-sized atomics.
#![cfg(target_has_atomic = "ptr")]
#![allow(dead_code)]
use core::sync::atomic::{AtomicUsize, Ordering};

// This structure represents a lazily initialized static usize value. Useful
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ extern crate cfg_if;
use core::mem::MaybeUninit;

mod error;
mod lazy;
mod util;

#[cfg(feature = "std")]
Expand All @@ -275,6 +274,8 @@ cfg_if! {
} else if #[cfg(getrandom_backend = "rdrand")] {
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
compile_error!("`rdrand` backend can be enabled only for x86 and x86-64 targets!");

mod lazy;
#[path = "rdrand.rs"] mod imp;
} else if #[cfg(getrandom_backend = "wasm_js")] {
#[cfg(not(all(
Expand Down Expand Up @@ -351,6 +352,7 @@ cfg_if! {
),
)
))] {
mod lazy;
mod util_libc;
mod use_file;
mod linux_android;
Expand Down Expand Up @@ -387,6 +389,7 @@ cfg_if! {
} else if #[cfg(windows)] {
#[path = "windows.rs"] mod imp;
} else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] {
mod lazy;
#[path = "rdrand.rs"] mod imp;
} else if #[cfg(all(
any(target_arch = "wasm32", target_arch = "wasm64"),
Expand Down
Loading