From c0316ee4fb8936cec8c473502b1a485a1f38c39f Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Thu, 28 May 2026 09:35:15 +0200 Subject: [PATCH] refactor: deprecate `RAND_MAX` constant in FreeBSD This constant does not seem to have had any changes since a binding was defined in all modules but the FreeBSD tree. This deprecation may or may not be worth it, as the only real change was between FreeBSD 12 and FreeBSD 13. --- src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 6 ++++++ src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 6 ++++++ src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 6 ++++++ src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 6 ++++++ src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs index d9c8c82f32311..66dad9182ee14 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -259,6 +259,12 @@ s! { } pub const ELAST: c_int = 96; +#[deprecated( + since = "0.2.187", + note = "This constant, among others often used in C for the purposes of denoting the latest \ + value or limit in a set of constants, has been deprecated. See #3131 for details and \ + discussion." +)] pub const RAND_MAX: c_int = 0x7fff_fffd; pub const KI_NSPARE_PTR: usize = 6; pub const MINCORE_SUPER: c_int = 0x20; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index 418c1b34f02b7..3e25b3dd91267 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -303,6 +303,12 @@ s! { } } +#[deprecated( + since = "0.2.187", + note = "This constant, among others often used in C for the purposes of denoting the latest \ + value or limit in a set of constants, has been deprecated. See #3131 for details and \ + discussion." +)] pub const RAND_MAX: c_int = 0x7fff_fffd; pub const ELAST: c_int = 97; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index 3367a1e2be418..b27bffbe9c46e 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -316,6 +316,12 @@ s! { } } +#[deprecated( + since = "0.2.187", + note = "This constant, among others often used in C for the purposes of denoting the latest \ + value or limit in a set of constants, has been deprecated. See #3131 for details and \ + discussion." +)] pub const RAND_MAX: c_int = 0x7fff_ffff; pub const ELAST: c_int = 97; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs index 61fa838b5b20e..0cb1f86ce41e9 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -318,6 +318,12 @@ s! { } } +#[deprecated( + since = "0.2.187", + note = "This constant, among others often used in C for the purposes of denoting the latest \ + value or limit in a set of constants, has been deprecated. See #3131 for details and \ + discussion." +)] pub const RAND_MAX: c_int = 0x7fff_ffff; pub const ELAST: c_int = 97; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs index ca2dcd5c8f4e8..063b8ccd050d8 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs @@ -320,6 +320,12 @@ s! { } } +#[deprecated( + since = "0.2.187", + note = "This constant, among others often used in C for the purposes of denoting the latest \ + value or limit in a set of constants, has been deprecated. See #3131 for details and \ + discussion." +)] pub const RAND_MAX: c_int = 0x7fff_ffff; pub const ELAST: c_int = 97;