Skip to content

Commit 3174f0c

Browse files
authored
MSRV 1.60: Conditionally import lazy.rs module (#472)
This simplifies lib.rs and allows for our testing code to be less convoluted. Split out from #471. CC @briansmith The MSRV for rand 0.9 is 1.61 and Debian stable is 1.63, so this is a fine MSRV bump. Signed-off-by: Joe Richey <[email protected]>
1 parent 79c29da commit 3174f0c

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

.clippy.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.57"
1+
msrv = "1.60"

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
matrix:
4646
os: [ubuntu-22.04, windows-2022]
47-
toolchain: [nightly, beta, stable, 1.57]
47+
toolchain: [nightly, beta, stable, "1.60"]
4848
# Only Test macOS on stable to reduce macOS CI jobs
4949
include:
5050
# x86_64-apple-darwin.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "getrandom"
33
version = "0.2.15" # Also update html_root_url in lib.rs when bumping this
44
edition = "2021"
5-
rust-version = "1.57" # Sync .clippy.toml, tests.yml, and README.md.
5+
rust-version = "1.60" # Sync .clippy.toml, tests.yml, and README.md.
66
authors = ["The Rand Project Developers"]
77
license = "MIT OR Apache-2.0"
88
description = "A small cross-platform library for retrieving random data from system source"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ crate features, WASM support and Custom RNGs see the
5252

5353
## Minimum Supported Rust Version
5454

55-
This crate requires Rust 1.57.0 or later.
55+
This crate requires Rust 1.60.0 or later.
5656

5757
## Platform Support
5858

src/lazy.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Helpers built around pointer-sized atomics.
2+
#![cfg(target_has_atomic = "ptr")]
13
#![allow(dead_code)]
24
use core::{
35
ffi::c_void,

src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ use crate::util::{slice_as_uninit_mut, slice_assume_init_mut};
216216
use core::mem::MaybeUninit;
217217

218218
mod error;
219+
mod lazy;
219220
mod util;
220221
// To prevent a breaking change when targets are added, we always export the
221222
// register_custom_getrandom macro, so old Custom RNG crates continue to build.
@@ -298,7 +299,6 @@ cfg_if! {
298299
))] {
299300
mod util_libc;
300301
mod use_file;
301-
mod lazy;
302302
mod linux_android;
303303
#[path = "linux_android_with_fallback.rs"] mod imp;
304304
} else if #[cfg(any(target_os = "android", target_os = "linux"))] {
@@ -309,7 +309,6 @@ cfg_if! {
309309
#[path = "solaris.rs"] mod imp;
310310
} else if #[cfg(target_os = "netbsd")] {
311311
mod util_libc;
312-
mod lazy;
313312
#[path = "netbsd.rs"] mod imp;
314313
} else if #[cfg(target_os = "fuchsia")] {
315314
#[path = "fuchsia.rs"] mod imp;
@@ -331,11 +330,9 @@ cfg_if! {
331330
} else if #[cfg(windows)] {
332331
#[path = "windows.rs"] mod imp;
333332
} else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] {
334-
mod lazy;
335333
#[path = "rdrand.rs"] mod imp;
336334
} else if #[cfg(all(feature = "rdrand",
337335
any(target_arch = "x86_64", target_arch = "x86")))] {
338-
mod lazy;
339336
#[path = "rdrand.rs"] mod imp;
340337
} else if #[cfg(all(feature = "js",
341338
any(target_arch = "wasm32", target_arch = "wasm64"),

0 commit comments

Comments
 (0)