diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 51abedcb8fc10..a282be77eeae9 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -1592,6 +1592,12 @@ pub const LOCK_UN: c_int = 8; pub const SS_ONSTACK: c_int = 1; pub const SS_DISABLE: c_int = 2; +#[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 PATH_MAX: c_int = 4096; pub const FD_SETSIZE: c_int = 1024; diff --git a/src/new/linux_uapi/linux/can/j1939.rs b/src/new/linux_uapi/linux/can/j1939.rs index fdf425ce6c0c1..589d9a04839d3 100644 --- a/src/new/linux_uapi/linux/can/j1939.rs +++ b/src/new/linux_uapi/linux/can/j1939.rs @@ -57,4 +57,10 @@ 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 J1939_FILTER_MAX: c_int = 512; diff --git a/src/new/linux_uapi/linux/can/raw.rs b/src/new/linux_uapi/linux/can/raw.rs index 470334bd5d147..a7b4a871a4bf2 100644 --- a/src/new/linux_uapi/linux/can/raw.rs +++ b/src/new/linux_uapi/linux/can/raw.rs @@ -3,6 +3,12 @@ pub use crate::linux::can::*; pub const SOL_CAN_RAW: c_int = SOL_CAN_BASE + CAN_RAW; +#[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 CAN_RAW_FILTER_MAX: c_int = 512; // FIXME(cleanup): use `c_enum!`, which needs to be adapted to allow omitting a type. diff --git a/src/new/qurt/limits.rs b/src/new/qurt/limits.rs index ae1a007ff1c66..998325dfa57b4 100644 --- a/src/new/qurt/limits.rs +++ b/src/new/qurt/limits.rs @@ -27,11 +27,29 @@ pub const USHRT_MAX: c_ushort = 65535; // POSIX Limits pub const ARG_MAX: c_int = 4096; pub const CHILD_MAX: c_int = 25; +#[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 LINK_MAX: c_int = 8; pub const MAX_CANON: c_int = 255; pub const MAX_INPUT: c_int = 255; +#[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 NAME_MAX: c_int = 255; pub const OPEN_MAX: c_int = 20; +#[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 PATH_MAX: c_int = 260; pub const PIPE_BUF: c_int = 512; pub const STREAM_MAX: c_int = 20; diff --git a/src/new/qurt/signal.rs b/src/new/qurt/signal.rs index f525fa15ff29e..91e084bb1634b 100644 --- a/src/new/qurt/signal.rs +++ b/src/new/qurt/signal.rs @@ -50,6 +50,12 @@ pub const SIG_SETMASK: c_int = 3; pub const POSIX_MSG: c_int = 7; pub const POSIX_NOTIF: c_int = 8; pub const SIGRTMIN: c_int = 10; +#[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 SIGRTMAX: c_int = 32; // Notification types (from QuRT signal.h) diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index 987eadf2465cc..467c71777abc8 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -932,6 +932,12 @@ pub const RTAX_IFP: c_int = 4; pub const RTAX_IFA: c_int = 5; pub const RTAX_AUTHOR: c_int = 6; pub const RTAX_BRD: c_int = 7; +#[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 RTAX_MAX: c_int = 8; pub const RTF_UP: c_int = 0x1; pub const RTF_GATEWAY: c_int = 0x2; @@ -1445,6 +1451,12 @@ pub const L_GETPROCINFO: c_int = 7; pub const L_GETXINFO: c_int = 8; // sys/limits.h +#[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 PATH_MAX: c_int = 1023; pub const PAGESIZE: c_int = 4096; pub const IOV_MAX: c_int = 16; @@ -1454,13 +1466,55 @@ pub const OPEN_MAX: c_int = 65534; pub const MAX_INPUT: c_int = 512; pub const MAX_CANON: c_int = 256; pub const ARG_MAX: c_int = 1048576; +#[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 BC_BASE_MAX: c_int = 99; +#[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 BC_DIM_MAX: c_int = 0x800; +#[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 BC_SCALE_MAX: c_int = 99; +#[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 BC_STRING_MAX: c_int = 0x800; +#[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 CHARCLASS_NAME_MAX: c_int = 14; pub const CHILD_MAX: c_int = 128; +#[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 COLL_WEIGHTS_MAX: c_int = 4; +#[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 EXPR_NEST_MAX: c_int = 32; pub const NZERO: c_int = 20; @@ -1537,11 +1591,25 @@ pub const SIGSTKSZ: size_t = 4096; pub const MINSIGSTKSZ: size_t = 1200; // sys/params.h +// FIXME(msrv): when we bump past the MSRV where `expect` and the `reason` +// parameter to that attribute got stabilized, use that to justfiy that this is +// not meant to be deprecated, but the value it relies on should be deprecated. +#[allow(deprecated)] pub const MAXPATHLEN: c_int = PATH_MAX + 1; pub const MAXSYMLINKS: c_int = 20; pub const MAXHOSTNAMELEN: c_int = 256; pub const MAXUPRC: c_int = 128; +#[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 NGROUPS_MAX: c_ulong = 2048; +// FIXME(msrv): when we bump past the MSRV where `expect` and the `reason` +// parameter to that attribute got stabilized, use that to justfiy that this is +// not meant to be deprecated, but the value it relies on should be deprecated. +#[allow(deprecated)] pub const NGROUPS: c_ulong = NGROUPS_MAX; pub const NOFILE: c_int = OPEN_MAX; @@ -1739,6 +1807,12 @@ pub const SIGXCPU: c_int = 24; pub const SIGXFSZ: c_int = 25; pub const SIGTRAP: c_int = 5; pub const SIGCLD: c_int = 20; +#[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 SIGRTMAX: c_int = 57; pub const SIGRTMIN: c_int = 50; pub const SI_USER: c_int = 0; @@ -1817,6 +1891,12 @@ pub const AF_INET6: c_int = 24; pub const AF_INTF: c_int = 20; pub const AF_RIF: c_int = 21; pub const AF_NDD: c_int = 23; +#[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 AF_MAX: c_int = 30; pub const PF_UNSPEC: c_int = AF_UNSPEC; pub const PF_UNIX: c_int = AF_UNIX; @@ -1843,6 +1923,16 @@ pub const PF_RIF: c_int = AF_RIF; pub const PF_INTF: c_int = AF_INTF; pub const PF_NDD: c_int = AF_NDD; pub const PF_INET6: c_int = AF_INET6; +// FIXME(msrv): when we bump past the MSRV where `expect` and the `reason` +// parameter to that attribute got stabilized, use that to justfiy that this is +// both meant to be deprecated, and is defined in terms of a deprecated value. +#[allow(deprecated)] +#[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 PF_MAX: c_int = AF_MAX; pub const SF_CLOSE: c_int = 1; pub const SF_REUSE: c_int = 2; diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 5ce676d2b7c2d..4bbccfb4aefee 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2014,6 +2014,12 @@ pub const CPU_STATE_USER: c_int = 0; pub const CPU_STATE_SYSTEM: c_int = 1; pub const CPU_STATE_IDLE: c_int = 2; pub const CPU_STATE_NICE: c_int = 3; +#[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 CPU_STATE_MAX: c_int = 4; pub const PROCESSOR_BASIC_INFO: c_int = 1; @@ -3396,13 +3402,61 @@ pub const HW_TARGET: c_int = 26; pub const HW_PRODUCT: c_int = 27; pub const HW_MAXID: c_int = 28; pub const USER_CS_PATH: c_int = 1; +#[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 USER_BC_BASE_MAX: c_int = 2; +#[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 USER_BC_DIM_MAX: c_int = 3; +#[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 USER_BC_SCALE_MAX: c_int = 4; +#[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 USER_BC_STRING_MAX: c_int = 5; +#[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 USER_COLL_WEIGHTS_MAX: c_int = 6; +#[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 USER_EXPR_NEST_MAX: c_int = 7; +#[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 USER_LINE_MAX: c_int = 8; +#[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 USER_RE_DUP_MAX: c_int = 9; pub const USER_POSIX2_VERSION: c_int = 10; pub const USER_POSIX2_C_BIND: c_int = 11; @@ -3447,10 +3501,6 @@ pub const SIGEV_THREAD: c_int = 3; pub const AIO_CANCELED: c_int = 2; pub const AIO_NOTCANCELED: c_int = 4; pub const AIO_ALLDONE: c_int = 1; -#[deprecated( - since = "0.2.64", - note = "Can vary at runtime. Use sysconf(3) instead" -)] pub const AIO_LISTIO_MAX: c_int = 16; pub const LIO_NOP: c_int = 0; pub const LIO_WRITE: c_int = 2; @@ -3526,6 +3576,12 @@ pub const RTV_SSTHRESH: c_int = 0x20; pub const RTV_RTT: c_int = 0x40; pub const RTV_RTTVAR: c_int = 0x80; +#[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 RTAX_MAX: c_int = 8; pub const KERN_PROCARGS2: c_int = 49; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 386da7de3279d..e1f21e09aad7d 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -641,13 +641,61 @@ pub const HW_MACHINE_PLATFORM: c_int = 12; pub const HW_SENSORS: c_int = 13; pub const HW_MAXID: c_int = 14; pub const USER_CS_PATH: c_int = 1; +#[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 USER_BC_BASE_MAX: c_int = 2; +#[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 USER_BC_DIM_MAX: c_int = 3; +#[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 USER_BC_SCALE_MAX: c_int = 4; +#[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 USER_BC_STRING_MAX: c_int = 5; +#[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 USER_COLL_WEIGHTS_MAX: c_int = 6; +#[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 USER_EXPR_NEST_MAX: c_int = 7; +#[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 USER_LINE_MAX: c_int = 8; +#[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 USER_RE_DUP_MAX: c_int = 9; pub const USER_POSIX2_VERSION: c_int = 10; pub const USER_POSIX2_C_BIND: c_int = 11; @@ -1168,6 +1216,12 @@ pub const RTM_VERSION: c_int = 7; pub const RTAX_MPLS1: c_int = 8; pub const RTAX_MPLS2: c_int = 9; pub const RTAX_MPLS3: c_int = 10; +#[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 RTAX_MAX: c_int = 11; const fn _CMSG_ALIGN(n: usize) -> usize { diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 3a3f8076bb51e..b846be125d397 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2320,13 +2320,61 @@ pub const HW_MACHINE_ARCH: c_int = 11; pub const HW_REALMEM: c_int = 12; pub const USER_CS_PATH: c_int = 1; +#[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 USER_BC_BASE_MAX: c_int = 2; +#[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 USER_BC_DIM_MAX: c_int = 3; +#[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 USER_BC_SCALE_MAX: c_int = 4; +#[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 USER_BC_STRING_MAX: c_int = 5; +#[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 USER_COLL_WEIGHTS_MAX: c_int = 6; +#[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 USER_EXPR_NEST_MAX: c_int = 7; +#[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 USER_LINE_MAX: c_int = 8; +#[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 USER_RE_DUP_MAX: c_int = 9; pub const USER_POSIX2_VERSION: c_int = 10; pub const USER_POSIX2_C_BIND: c_int = 11; @@ -2444,6 +2492,12 @@ pub const SO_TS_BINTIME: c_int = 1; pub const SO_TS_REALTIME: c_int = 2; pub const SO_TS_MONOTONIC: c_int = 3; pub const SO_TS_DEFAULT: c_int = SO_TS_REALTIME_MICRO; +#[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 SO_TS_CLOCK_MAX: c_int = SO_TS_MONOTONIC; pub const LOCAL_CREDS: c_int = 2; @@ -2724,6 +2778,12 @@ pub const IFNET_SLOWHZ: c_int = 1; pub const IFAN_ARRIVAL: c_int = 0; pub const IFAN_DEPARTURE: c_int = 1; +#[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 IFSTATMAX: c_int = 800; pub const RSS_FUNC_NONE: c_int = 0; @@ -3061,6 +3121,12 @@ pub const TCP_PCAP_IN: c_int = 4096; pub const TCP_FUNCTION_BLK: c_int = 8192; pub const TCP_FUNCTION_ALIAS: c_int = 8193; pub const TCP_FASTOPEN_PSK_LEN: c_int = 16; +#[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 TCP_FUNCTION_NAME_LEN_MAX: c_int = 32; pub const TCP_REUSPORT_LB_NUMA: c_int = 1026; @@ -3428,6 +3494,12 @@ pub const KKST_STATE_RUNNING: c_int = 2; // Constants about priority. pub const PRI_MIN: c_int = 0; +#[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 PRI_MAX: c_int = 255; pub const PRI_MIN_ITHD: c_int = PRI_MIN; #[deprecated(since = "0.2.133", note = "Not stable across OS versions")] @@ -3493,6 +3565,10 @@ pub const PRI_MAX_TIMESHARE: c_int = PRI_MIN_IDLE - 1; #[allow(deprecated)] pub const PUSER: c_int = PRI_MIN_TIMESHARE; pub const PRI_MIN_IDLE: c_int = 224; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const PRI_MAX_IDLE: c_int = PRI_MAX; pub const NZERO: c_int = 0; @@ -3511,6 +3587,11 @@ pub const CHILD_MAX: c_int = 40; /// max command name remembered pub const MAXCOMLEN: usize = 19; /// max interpreter file name length +// FIXME(msrv): switch this to use an `expect` and the `reason` attribute +// parameter once we reach an MSRV were those are stabilized. this is not meant +// for deprecation, but reading straight from the value that this depends on is +// considered deprecated behavior. +#[allow(deprecated)] pub const MAXINTERP: c_int = crate::PATH_MAX; /// max login name length (incl. NUL) pub const MAXLOGNAME: c_int = 33; @@ -3519,6 +3600,10 @@ pub const MAXUPRC: c_int = CHILD_MAX; /// max bytes for an exec function pub const NCARGS: c_int = ARG_MAX; /// /* max number groups +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const NGROUPS: c_int = NGROUPS_MAX + 1; /// max open files per process pub const NOFILE: c_int = OPEN_MAX; @@ -3531,9 +3616,21 @@ pub const MAX_CANON: c_int = 255; /// max bytes in terminal input pub const MAX_INPUT: c_int = 255; /// max bytes in a file name +#[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 NAME_MAX: c_int = 255; pub const MAXSYMLINKS: c_int = 32; /// max supplemental group id'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 NGROUPS_MAX: c_int = 1023; /// max open files per process pub const OPEN_MAX: c_int = 64; @@ -3548,22 +3645,76 @@ pub const _POSIX_SSIZE_MAX: c_int = 32767; pub const _POSIX_STREAM_MAX: c_int = 8; /// max ibase/obase values in bc(1) +#[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 BC_BASE_MAX: c_int = 99; /// max array elements in bc(1) +#[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 BC_DIM_MAX: c_int = 2048; /// max scale value in bc(1) +#[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 BC_SCALE_MAX: c_int = 99; /// max const string length in bc(1) +#[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 BC_STRING_MAX: c_int = 1000; /// max character class name size +#[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 CHARCLASS_NAME_MAX: c_int = 14; /// max weights for order keyword +#[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 COLL_WEIGHTS_MAX: c_int = 10; /// max expressions nested in expr(1) +#[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 EXPR_NEST_MAX: c_int = 32; /// max bytes in an input line +#[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 LINE_MAX: c_int = 2048; /// max RE's in interval notation +#[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 RE_DUP_MAX: c_int = 255; pub const _POSIX2_BC_BASE_MAX: c_int = 99; @@ -3971,6 +4122,12 @@ pub const RTF_FIXEDMTU: c_int = 0x80000; pub const RTM_VERSION: c_int = 5; +#[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 RTAX_MAX: c_int = 8; // sys/signal.h @@ -4018,6 +4175,12 @@ pub const SCTP_PR_SCTP_TTL: c_int = 0x0001; pub const SCTP_PR_SCTP_PRIO: c_int = 0x0002; pub const SCTP_PR_SCTP_BUF: c_int = SCTP_PR_SCTP_PRIO; pub const SCTP_PR_SCTP_RTX: c_int = 0x0003; +#[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 SCTP_PR_SCTP_MAX: c_int = SCTP_PR_SCTP_RTX; pub const SCTP_PR_SCTP_ALL: c_int = 0x000f; @@ -4100,6 +4263,12 @@ pub const SCTP_ASSOC_SUPPORTS_ASCONF: c_int = 0x03; pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: c_int = 0x04; pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: c_int = 0x05; pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: c_int = 0x06; +#[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 SCTP_ASSOC_SUPPORTS_MAX: c_int = 0x06; pub const SCTP_ADDR_AVAILABLE: c_int = 0x0001; @@ -4317,10 +4486,18 @@ safe_f! { PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX } + // FIXME(msrv): once we bump MSRV past stabilization of `expect` and + // `reason`, use those to mention this value is not meant for deprecation, + // but the value it relies on is. + #[allow(deprecated)] pub const fn PR_SCTP_INVALID_POLICY(x: c_int) -> bool { PR_SCTP_POLICY(x) > SCTP_PR_SCTP_MAX } + // FIXME(msrv): once we bump MSRV past stabilization of `expect` and + // `reason`, use those to mention this value is not meant for deprecation, + // but the value it relies on is. + #[allow(deprecated)] pub const fn PR_SCTP_VALID_POLICY(x: c_int) -> bool { PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX } diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index b8d9e779830d9..0c010bda9fbb0 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -408,10 +408,6 @@ s! { // Non-public helper constant const SIZEOF_LONG: usize = size_of::(); -#[deprecated( - since = "0.2.64", - note = "Can vary at runtime. Use sysconf(3) instead" -)] pub const AIO_LISTIO_MAX: c_int = 16; pub const AIO_CANCELED: c_int = 1; pub const AIO_NOTCANCELED: c_int = 2; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 74a6fa8142b27..730cd43c0396c 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -163,7 +163,17 @@ pub const FIOASYNC: c_ulong = 0x8004667d; pub const FIOSETOWN: c_ulong = 0x8004667c; pub const FIOGETOWN: c_ulong = 0x4004667b; +#[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 PATH_MAX: c_int = 1024; +// FIXME(msrv): when we bump past the MSRV where `expect` and the `reason` +// parameter to that attribute got stabilized, use that to justfiy that this is +// not meant to be deprecated, but the value it relies on should be deprecated. +#[allow(deprecated)] pub const MAXPATHLEN: c_int = PATH_MAX; pub const IOV_MAX: c_int = 1024; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 50e45dbebe737..5c4d3a87c9345 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1715,6 +1715,12 @@ pub const KVME_FLAG_PAGEABLE: c_int = 0x000000008; pub const KVME_FLAG_GROWS_UP: c_int = 0x000000010; pub const KVME_FLAG_GROWS_DOWN: c_int = 0x000000020; +#[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 NGROUPS_MAX: c_int = 16; pub const KI_NGROUPS: c_int = 16; @@ -1791,6 +1797,12 @@ pub const RTM_CHGADDR: c_int = 0x18; pub const RTA_TAG: c_int = 0x100; pub const RTAX_TAG: c_int = 8; +#[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 RTAX_MAX: c_int = 9; // For eventfd diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index e642ef18ebc27..df3d51c04dabc 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1507,6 +1507,12 @@ pub const ISOFSMNT_EXTATT: c_int = 0x4; // enable extended attr pub const ISOFSMNT_NOJOLIET: c_int = 0x8; // disable Joliet Ext pub const ISOFSMNT_SESS: c_int = 0x10; // use iso_args.sess +#[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 NFS_ARGSVERSION: c_int = 4; // change when nfs_args changes pub const NFSMNT_RESVPORT: c_int = 0; // always use reserved ports @@ -1814,6 +1820,12 @@ pub const RTAX_BFD: c_int = 11; pub const RTAX_DNS: c_int = 12; pub const RTAX_STATIC: c_int = 13; pub const RTAX_SEARCH: c_int = 14; +#[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 RTAX_MAX: c_int = 15; const fn _ALIGN(p: usize) -> usize { diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index 504eec69841e7..e6a771e94a8f4 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -897,8 +897,20 @@ pub const ARG_MAX: c_int = 32000; pub const CHILD_MAX: c_int = 256; pub const IOV_MAX: c_int = 1024; pub const PTHREAD_STACK_MIN: size_t = 65536; +#[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 PATH_MAX: c_int = 4096; pub const PIPE_BUF: usize = 4096; +#[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 NGROUPS_MAX: c_int = 1024; pub const FILENAME_MAX: c_int = 4096; diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 8fae6f704d357..953784d5336f3 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -902,6 +902,12 @@ pub const MINSIGSTKSZ: size_t = 8192; pub const SIGSTKSZ: size_t = 16384; pub const IOV_MAX: c_int = 1024; +#[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 PATH_MAX: c_int = 1024; pub const SA_NOCLDSTOP: c_int = 0x01; diff --git a/src/unix/haiku/native.rs b/src/unix/haiku/native.rs index 99ceab8a7519b..8a2076df7e023 100644 --- a/src/unix/haiku/native.rs +++ b/src/unix/haiku/native.rs @@ -629,6 +629,11 @@ pub const B_SYMBOL_TYPE_ANY: i32 = 0x5; // storage/StorageDefs.h pub const B_DEV_NAME_LENGTH: usize = 128; pub const B_FILE_NAME_LENGTH: usize = crate::FILENAME_MAX as usize; +// FIXME(msrv): replace this with an `expect` and a `reason` parameter once we +// reach an MSRV where those are stable. This constant does not require +// deprecation, but reading straight from the value that it is defined as is not +// a good idea. +#[allow(deprecated)] pub const B_PATH_NAME_LENGTH: usize = crate::PATH_MAX as usize; pub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1; pub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15; diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index af86822c634b3..c178218c53b29 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -1230,6 +1230,12 @@ pub const PF_IPX: c_int = 23; pub const PF_SIP: c_int = 24; pub const PF_PIP: c_int = 25; pub const PF_INET6: c_int = 26; +#[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 PF_MAX: c_int = 27; pub const AF_UNSPEC: c_int = 0; pub const AF_LOCAL: c_int = 1; @@ -1260,6 +1266,12 @@ pub const AF_IPX: c_int = 23; pub const AF_SIP: c_int = 24; pub const pseudo_AF_PIP: c_int = 25; pub const AF_INET6: c_int = 26; +#[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 AF_MAX: c_int = 27; pub const SOMAXCONN: c_int = 4096; pub const _SS_SIZE: usize = 128; @@ -1526,7 +1538,19 @@ pub const _POSIX_QLIMIT: usize = 1; pub const _POSIX_HIWAT: usize = 512; pub const _POSIX_UIO_MAXIOV: usize = 16; pub const _POSIX_CLOCKRES_MIN: usize = 20000000; +#[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 NAME_MAX: usize = 255; +#[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 NGROUPS_MAX: usize = 256; pub const _POSIX_THREAD_KEYS_MAX: usize = 128; pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: usize = 4; @@ -3207,6 +3231,12 @@ pub const RTLD_DI_PROFILEOUT: c_int = 8; pub const RTLD_DI_TLS_MODID: c_int = 9; pub const RTLD_DI_TLS_DATA: c_int = 10; pub const RTLD_DI_PHDR: c_int = 11; +#[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 RTLD_DI_MAX: c_int = 11; pub const SI_ASYNCIO: c_int = -4; diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index c6dd17697adae..481b6937b3ad1 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -1681,6 +1681,12 @@ pub const NFQA_CFG_F_CONNTRACK: c_int = 0x0002; pub const NFQA_CFG_F_GSO: c_int = 0x0004; pub const NFQA_CFG_F_UID_GID: c_int = 0x0008; pub const NFQA_CFG_F_SECCTX: c_int = 0x0010; +#[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 NFQA_CFG_F_MAX: c_int = 0x0020; pub const NFQA_SKB_CSUMNOTREADY: c_int = 0x0001; @@ -2001,6 +2007,12 @@ pub const NFT_REG_1: c_int = 1; pub const NFT_REG_2: c_int = 2; pub const NFT_REG_3: c_int = 3; pub const NFT_REG_4: c_int = 4; +#[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 __NFT_REG_MAX: c_int = 5; pub const NFT_REG32_00: c_int = 8; pub const NFT_REG32_01: c_int = 9; @@ -2050,6 +2062,12 @@ pub const NFT_MSG_NEWOBJ: c_int = 18; pub const NFT_MSG_GETOBJ: c_int = 19; pub const NFT_MSG_DELOBJ: c_int = 20; pub const NFT_MSG_GETOBJ_RESET: c_int = 21; +#[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 NFT_MSG_MAX: c_int = 25; pub const NFT_SET_ANONYMOUS: c_int = 0x1; @@ -2181,31 +2199,151 @@ pub const NFT_NG_INCREMENTAL: c_int = 0; pub const NFT_NG_RANDOM: c_int = 1; // linux/input.h +#[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 FF_MAX: crate::__u16 = 0x7f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const FF_CNT: usize = FF_MAX as usize + 1; // linux/input-event-codes.h +#[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 INPUT_PROP_MAX: crate::__u16 = 0x1f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1; +#[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 EV_MAX: crate::__u16 = 0x1f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const EV_CNT: usize = EV_MAX as usize + 1; +#[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 SYN_MAX: crate::__u16 = 0xf; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const SYN_CNT: usize = SYN_MAX as usize + 1; +#[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 KEY_MAX: crate::__u16 = 0x2ff; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const KEY_CNT: usize = KEY_MAX as usize + 1; +#[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 REL_MAX: crate::__u16 = 0x0f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const REL_CNT: usize = REL_MAX as usize + 1; +#[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 ABS_MAX: crate::__u16 = 0x3f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const ABS_CNT: usize = ABS_MAX as usize + 1; +#[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 SW_MAX: crate::__u16 = 0x0f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const SW_CNT: usize = SW_MAX as usize + 1; +#[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 MSC_MAX: crate::__u16 = 0x07; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const MSC_CNT: usize = MSC_MAX as usize + 1; +#[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 LED_MAX: crate::__u16 = 0x0f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const LED_CNT: usize = LED_MAX as usize + 1; +#[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 REP_MAX: crate::__u16 = 0x01; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const REP_CNT: usize = REP_MAX as usize + 1; +#[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 SND_MAX: crate::__u16 = 0x07; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const SND_CNT: usize = SND_MAX as usize + 1; // linux/uinput.h @@ -2825,6 +2963,12 @@ pub const PR_SCHED_CORE_GET: c_int = 0; pub const PR_SCHED_CORE_CREATE: c_int = 1; pub const PR_SCHED_CORE_SHARE_TO: c_int = 2; pub const PR_SCHED_CORE_SHARE_FROM: c_int = 3; +#[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 PR_SCHED_CORE_MAX: c_int = 4; pub const PR_SCHED_CORE_SCOPE_THREAD: c_int = 0; pub const PR_SCHED_CORE_SCOPE_THREAD_GROUP: c_int = 1; @@ -3128,6 +3272,12 @@ pub const KERN_S390_USER_DEBUG_LOGGING: c_int = 51; pub const KERN_CORE_USES_PID: c_int = 52; pub const KERN_TAINTED: c_int = 53; pub const KERN_CADPID: c_int = 54; +#[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 KERN_PIDMAX: c_int = 55; pub const KERN_CORE_PATTERN: c_int = 56; pub const KERN_PANIC_ON_OOPS: c_int = 57; @@ -3136,6 +3286,12 @@ pub const KERN_HPPA_UNALIGNED: c_int = 59; pub const KERN_PRINTK_RATELIMIT: c_int = 60; pub const KERN_PRINTK_RATELIMIT_BURST: c_int = 61; pub const KERN_PTY: c_int = 62; +#[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 KERN_NGROUPS_MAX: c_int = 63; pub const KERN_SPARC_SCONS_PWROFF: c_int = 64; pub const KERN_HZ_TIMER: c_int = 65; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 4c9392ab2434e..82f0937303e69 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1714,6 +1714,12 @@ pub const SKF_AD_VLAN_TAG_PRESENT: c_int = 48; pub const SKF_AD_PAY_OFFSET: c_int = 52; pub const SKF_AD_RANDOM: c_int = 56; pub const SKF_AD_VLAN_TPID: c_int = 60; +#[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 SKF_AD_MAX: c_int = 64; pub const SKF_NET_OFF: c_int = -0x100000; pub const SKF_LL_OFF: c_int = -0x200000; @@ -2015,6 +2021,12 @@ pub const NFQA_CFG_F_CONNTRACK: c_int = 0x0002; pub const NFQA_CFG_F_GSO: c_int = 0x0004; pub const NFQA_CFG_F_UID_GID: c_int = 0x0008; pub const NFQA_CFG_F_SECCTX: c_int = 0x0010; +#[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 NFQA_CFG_F_MAX: c_int = 0x0020; pub const NFQA_SKB_CSUMNOTREADY: c_int = 0x0001; @@ -3120,6 +3132,12 @@ pub const NFT_REG_1: c_int = 1; pub const NFT_REG_2: c_int = 2; pub const NFT_REG_3: c_int = 3; pub const NFT_REG_4: c_int = 4; +#[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 __NFT_REG_MAX: c_int = 5; pub const NFT_REG32_00: c_int = 8; pub const NFT_REG32_01: c_int = 9; @@ -3174,6 +3192,12 @@ cfg_if! { } } +#[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 NFT_MSG_MAX: c_int = 34; pub const NFT_SET_ANONYMOUS: c_int = 0x1; @@ -3304,7 +3328,17 @@ pub const NFT_NG_INCREMENTAL: c_int = 0; pub const NFT_NG_RANDOM: c_int = 1; // linux/input.h +#[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 FF_MAX: __u16 = 0x7f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const FF_CNT: usize = FF_MAX as usize + 1; // linux/input-event-codes.h @@ -3315,27 +3349,137 @@ pub const INPUT_PROP_SEMI_MT: __u16 = 0x03; pub const INPUT_PROP_TOPBUTTONPAD: __u16 = 0x04; pub const INPUT_PROP_POINTING_STICK: __u16 = 0x05; pub const INPUT_PROP_ACCELEROMETER: __u16 = 0x06; +#[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 INPUT_PROP_MAX: __u16 = 0x1f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1; +#[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 EV_MAX: __u16 = 0x1f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const EV_CNT: usize = EV_MAX as usize + 1; +#[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 SYN_MAX: __u16 = 0xf; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const SYN_CNT: usize = SYN_MAX as usize + 1; +#[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 KEY_MAX: __u16 = 0x2ff; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const KEY_CNT: usize = KEY_MAX as usize + 1; +#[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 REL_MAX: __u16 = 0x0f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const REL_CNT: usize = REL_MAX as usize + 1; +#[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 ABS_MAX: __u16 = 0x3f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const ABS_CNT: usize = ABS_MAX as usize + 1; +#[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 SW_MAX: __u16 = 0x10; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const SW_CNT: usize = SW_MAX as usize + 1; +#[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 MSC_MAX: __u16 = 0x07; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const MSC_CNT: usize = MSC_MAX as usize + 1; +#[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 LED_MAX: __u16 = 0x0f; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const LED_CNT: usize = LED_MAX as usize + 1; +#[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 REP_MAX: __u16 = 0x01; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const REP_CNT: usize = REP_MAX as usize + 1; +#[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 SND_MAX: __u16 = 0x07; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const SND_CNT: usize = SND_MAX as usize + 1; // linux/uinput.h @@ -3559,6 +3703,12 @@ pub const SCTP_PR_SCTP_NONE: c_int = 0x0000; pub const SCTP_PR_SCTP_TTL: c_int = 0x0010; pub const SCTP_PR_SCTP_RTX: c_int = 0x0020; pub const SCTP_PR_SCTP_PRIO: c_int = 0x0030; +#[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 SCTP_PR_SCTP_MAX: c_int = SCTP_PR_SCTP_PRIO; pub const SCTP_PR_SCTP_MASK: c_int = 0x0030; pub const SCTP_ENABLE_RESET_STREAM_REQ: c_int = 0x01; @@ -3668,6 +3818,12 @@ pub const KERN_S390_USER_DEBUG_LOGGING: c_int = 51; pub const KERN_CORE_USES_PID: c_int = 52; pub const KERN_TAINTED: c_int = 53; pub const KERN_CADPID: c_int = 54; +#[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 KERN_PIDMAX: c_int = 55; pub const KERN_CORE_PATTERN: c_int = 56; pub const KERN_PANIC_ON_OOPS: c_int = 57; @@ -3676,6 +3832,12 @@ pub const KERN_HPPA_UNALIGNED: c_int = 59; pub const KERN_PRINTK_RATELIMIT: c_int = 60; pub const KERN_PRINTK_RATELIMIT_BURST: c_int = 61; pub const KERN_PTY: c_int = 62; +#[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 KERN_NGROUPS_MAX: c_int = 63; pub const KERN_SPARC_SCONS_PWROFF: c_int = 64; pub const KERN_HZ_TIMER: c_int = 65; diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs index 9a62e4d57d6da..4390100937668 100644 --- a/src/unix/linux_like/linux/musl/b32/hexagon.rs +++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs @@ -103,6 +103,12 @@ s! { pub const AF_FILE: c_int = 1; pub const AF_KCM: c_int = 41; +#[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 AF_MAX: c_int = 43; pub const AF_QIPCRTR: c_int = 42; pub const EADDRINUSE: c_int = 98; @@ -236,6 +242,12 @@ pub const O_SYNC: c_int = 1052672; pub const O_RSYNC: c_int = 1052672; pub const PF_FILE: c_int = 1; pub const PF_KCM: c_int = 41; +#[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 PF_MAX: c_int = 43; pub const PF_QIPCRTR: c_int = 42; pub const SA_ONSTACK: c_int = 0x08000000; diff --git a/src/unix/linux_like/linux_l4re_shared.rs b/src/unix/linux_like/linux_l4re_shared.rs index 6b320ff4effa2..9983ab86c586f 100644 --- a/src/unix/linux_like/linux_l4re_shared.rs +++ b/src/unix/linux_like/linux_l4re_shared.rs @@ -1175,6 +1175,12 @@ pub const PR_SCHED_CORE_GET: c_int = 0; pub const PR_SCHED_CORE_CREATE: c_int = 1; pub const PR_SCHED_CORE_SHARE_TO: c_int = 2; pub const PR_SCHED_CORE_SHARE_FROM: c_int = 3; +#[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 PR_SCHED_CORE_MAX: c_int = 4; pub const PR_SCHED_CORE_SCOPE_THREAD: c_int = 0; pub const PR_SCHED_CORE_SCOPE_THREAD_GROUP: c_int = 1; @@ -1365,6 +1371,12 @@ pub const RT_CLASS_UNSPEC: u8 = 0; pub const RT_CLASS_DEFAULT: u8 = 253; pub const RT_CLASS_MAIN: u8 = 254; pub const RT_CLASS_LOCAL: u8 = 255; +#[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 RT_CLASS_MAX: u8 = 255; pub const MAX_ADDR_LEN: usize = 7; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 7b8397d1c7bad..bce23be30c6f0 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -1046,7 +1046,19 @@ pub const LOCK_UN: c_int = 8; pub const SS_ONSTACK: c_int = 1; pub const SS_DISABLE: c_int = 2; +#[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 NAME_MAX: c_int = 255; +#[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 PATH_MAX: c_int = 4096; pub const UIO_MAXIOV: c_int = 1024; diff --git a/src/unix/newlib/horizon/mod.rs b/src/unix/newlib/horizon/mod.rs index e94a0bb1c13d8..a940c54f0b218 100644 --- a/src/unix/newlib/horizon/mod.rs +++ b/src/unix/newlib/horizon/mod.rs @@ -169,6 +169,12 @@ pub const EAI_SYSTEM: c_int = 11; pub const EAI_BADHINTS: c_int = 12; pub const EAI_PROTOCOL: c_int = 13; pub const EAI_OVERFLOW: c_int = 14; +#[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 EAI_MAX: c_int = 15; pub const AF_UNIX: c_int = 1; diff --git a/src/unix/newlib/rtems/mod.rs b/src/unix/newlib/rtems/mod.rs index ec4534e32a11f..95a09c9362103 100644 --- a/src/unix/newlib/rtems/mod.rs +++ b/src/unix/newlib/rtems/mod.rs @@ -56,6 +56,12 @@ pub const SIGWINCH: c_int = 24; pub const SIGUSR1: c_int = 25; pub const SIGUSR2: c_int = 26; pub const SIGRTMIN: c_int = 27; +#[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 SIGRTMAX: c_int = 31; pub const SIGXCPU: c_int = 24; pub const SIGXFSZ: c_int = 25; diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index 082e48739fe35..cc35c8a505ed0 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -1154,6 +1154,12 @@ pub const LOCK_UN: c_int = 0x8; pub const SS_ONSTACK: c_int = 1; pub const SS_DISABLE: c_int = 2; +#[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 PATH_MAX: c_int = 1024; pub const UIO_MAXIOV: c_int = 1024; @@ -2340,13 +2346,61 @@ pub const TIOCSTOP: c_int = 29807; pub const TIOCSWINSZ: c_int = -2146929561; pub const USER_CS_PATH: c_int = 1; +#[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 USER_BC_BASE_MAX: c_int = 2; +#[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 USER_BC_DIM_MAX: c_int = 3; +#[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 USER_BC_SCALE_MAX: c_int = 4; +#[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 USER_BC_STRING_MAX: c_int = 5; +#[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 USER_COLL_WEIGHTS_MAX: c_int = 6; +#[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 USER_EXPR_NEST_MAX: c_int = 7; +#[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 USER_LINE_MAX: c_int = 8; +#[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 USER_RE_DUP_MAX: c_int = 9; pub const USER_POSIX2_VERSION: c_int = 10; pub const USER_POSIX2_C_BIND: c_int = 11; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 12db71c7a57a5..1c59186e67361 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -333,6 +333,12 @@ cfg_if! { } // limits.h +#[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 PATH_MAX: c_int = 4096; // fcntl.h diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs index b31c31bd1f6c8..9ac9875fa240d 100644 --- a/src/unix/solarish/illumos.rs +++ b/src/unix/solarish/illumos.rs @@ -109,6 +109,12 @@ pub const FD_CLOFORK: c_int = 2; pub const FIL_ATTACH: c_int = 0x1; pub const FIL_DETACH: c_int = 0x2; pub const FIL_LIST: c_int = 0x3; +#[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 FILNAME_MAX: c_int = 32; pub const FILF_PROG: c_int = 0x1; pub const FILF_AUTO: c_int = 0x2; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 6c5d183efd54c..f9032f83af6f9 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -823,6 +823,12 @@ pub const NOEXPR: crate::nl_item = 57; pub const _DATE_FMT: crate::nl_item = 58; pub const MAXSTRMSG: crate::nl_item = 58; +#[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 PATH_MAX: c_int = 1024; pub const SA_ONSTACK: c_int = 0x00000001; diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index 00428543d7aff..2f2f9e01b9e90 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -577,6 +577,10 @@ s! { s_no_extra_traits! { // dirent.h + // FIXME(msrv): once we bump MSRV past stabilization of `expect` and + // `reason`, use those to mention this value is not meant for deprecation, + // but the value it relies on is. + #[allow(deprecated)] pub struct dirent { pub d_ino: crate::ino_t, pub d_name: [c_char; _PARM_NAME_MAX as usize + 1], @@ -704,6 +708,12 @@ pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; pub const PTHREAD_STACK_MIN: usize = 4096; +#[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 _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30; //sched.h @@ -1043,6 +1053,12 @@ pub const AF_SOCKDEV: c_int = 31; pub const AF_TIPC: c_int = 33; pub const AF_MIPC: c_int = 34; pub const AF_MIPC_SAFE: c_int = 35; +#[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 AF_MAX: c_int = 39; // termios.h @@ -1173,6 +1189,16 @@ pub const FIOGETNAME: c_int = 18; pub const FIONBIO: c_int = 0x90040010; // limits.h +#[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." +)] +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is both meant for deprecation and relies on a +// deprecated value. +#[allow(deprecated)] pub const PATH_MAX: c_int = _PARM_PATH_MAX; pub const _POSIX_PATH_MAX: c_int = 256; @@ -1317,7 +1343,19 @@ pub const AT_REMOVEDIR: c_int = 0x200; pub const AT_SYMLINK_FOLLOW: c_int = 0x400; // vxParams.h definitions +#[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 _PARM_NAME_MAX: c_int = 255; +#[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 _PARM_PATH_MAX: c_int = 1024; // WAIT STUFF @@ -1332,6 +1370,10 @@ const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = pthread_mutexattr_t { mutexAttrType: PTHREAD_MUTEX_DEFAULT, mutexAttrPshared: 1, }; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { mutexSemId: null_mut(), mutexValid: PTHREAD_VALID_OBJ, @@ -1347,6 +1389,10 @@ const PTHREAD_CONDATTR_INITIALIZER: pthread_condattr_t = pthread_condattr_t { condAttrPshared: 1, condAttrClockId: CLOCK_REALTIME, }; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { condSemId: null_mut(), condValid: PTHREAD_VALID_OBJ, @@ -1363,6 +1409,10 @@ const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = pthread_rwlockattr_ rwlockAttrMaxReaders: 0, rwlockAttrConformOpt: 1, }; +// FIXME(msrv): once we bump MSRV past stabilization of `expect` and `reason`, +// use those to mention this value is not meant for deprecation, but the value +// it relies on is. +#[allow(deprecated)] pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { rwlockSemId: null_mut(), rwlockReadersRefCount: 0,