Skip to content

Commit f6f19e0

Browse files
authored
Remove deprecated features. (#1154)
Now that 0.38 is on a branch and `main` is accepting incompatiblle features, remove all features marked with `#[deprecated]`. And start a CHANGELOG.md for documenting breaking API changes, to help people update to the eventual 1.0.
1 parent 2955504 commit f6f19e0

File tree

19 files changed

+22
-263
lines changed

19 files changed

+22
-263
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changes from 0.38.x to 1.0
2+
3+
`rustix::thread::FutexOperation` and `rustix::thread::futex` are removed. Use
4+
the functions in the `rustix::thread::futex` module instead.
5+
6+
`rustix::process::waitpid`'s return type changed from `WaitStatus` to
7+
`(Pid, WaitStatus)`, to additionally return the pid of the child.
8+
9+
The "cc" feature is removed. It hasn't had any effect for several
10+
major releases.
11+
12+
All explicitly deprecated functions and types have been removed. Their
13+
deprecation messages will have identified alternatives.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ rustc-dep-of-std = [
242242
"compiler_builtins?/rustc-dep-of-std",
243243
]
244244

245-
# Obsolete and deprecated.
246-
cc = []
247-
248245
# Enable `rustix::io::try_close`. The rustix developers do not intend the
249246
# existence of this feature to imply that anyone should use it.
250247
try_close = []

src/backend/libc/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ pub(crate) mod mm;
117117
#[cfg(linux_kernel)]
118118
#[cfg(feature = "mount")]
119119
pub(crate) mod mount;
120-
#[cfg(linux_kernel)]
121-
#[cfg(all(feature = "fs", not(feature = "mount")))]
122-
pub(crate) mod mount; // for deprecated mount functions in "fs"
123120
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
124121
#[cfg(feature = "net")]
125122
pub(crate) mod net;

src/backend/libc/net/send_recv.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ bitflags! {
2828
/// `MSG_DONTWAIT`
2929
#[cfg(not(windows))]
3030
const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
31-
/// Deprecated alias for [`EOR`].
32-
///
33-
/// [`EOR`]: Self::EOR
34-
#[cfg(not(windows))]
35-
#[deprecated(note = "`rustix::net::SendFlags::EOT` is renamed to `rustix::net::SendFlags::EOR`.")]
36-
const EOT = bitcast!(c::MSG_EOR);
3731
/// `MSG_EOR`
3832
#[cfg(not(windows))]
3933
const EOR = bitcast!(c::MSG_EOR);

src/backend/libc/shm/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use crate::backend::conv::{c_str, ret, ret_owned_fd};
55
use crate::fd::OwnedFd;
66
use crate::fs::Mode;
77
use crate::io;
8-
use crate::shm::ShmOFlags;
8+
use crate::shm;
99

10-
pub(crate) fn shm_open(name: &CStr, oflags: ShmOFlags, mode: Mode) -> io::Result<OwnedFd> {
10+
pub(crate) fn shm_open(name: &CStr, oflags: shm::OFlags, mode: Mode) -> io::Result<OwnedFd> {
1111
// On this platforms, `mode_t` is `u16` and can't be passed directly to a
1212
// variadic function.
1313
#[cfg(apple)]

src/backend/libc/thread/futex.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,44 +48,6 @@ pub(crate) enum Operation {
4848
LockPi2 = bitcast!(c::FUTEX_LOCK_PI2),
4949
}
5050

51-
/// `FUTEX_*` operations for use with the [`futex`] function.
52-
///
53-
/// [`futex`]: fn@crate::thread::futex
54-
// TODO: Deprecate this now that we have a new typed API.
55-
/*
56-
#[deprecated(
57-
since = "0.38.35",
58-
note = "
59-
The `futex` function and `FutexOperation` enum are deprecated. There are
60-
individual functions available to perform futex operations with improved
61-
type safety. See the `rustix::thread::futex` module."
62-
)]
63-
*/
64-
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
65-
#[repr(u32)]
66-
pub enum FutexOperation {
67-
/// `FUTEX_WAIT`
68-
Wait = bitcast!(c::FUTEX_WAIT),
69-
/// `FUTEX_WAKE`
70-
Wake = bitcast!(c::FUTEX_WAKE),
71-
/// `FUTEX_FD`
72-
Fd = bitcast!(c::FUTEX_FD),
73-
/// `FUTEX_REQUEUE`
74-
Requeue = bitcast!(c::FUTEX_REQUEUE),
75-
/// `FUTEX_CMP_REQUEUE`
76-
CmpRequeue = bitcast!(c::FUTEX_CMP_REQUEUE),
77-
/// `FUTEX_WAKE_OP`
78-
WakeOp = bitcast!(c::FUTEX_WAKE_OP),
79-
/// `FUTEX_LOCK_PI`
80-
LockPi = bitcast!(c::FUTEX_LOCK_PI),
81-
/// `FUTEX_UNLOCK_PI`
82-
UnlockPi = bitcast!(c::FUTEX_UNLOCK_PI),
83-
/// `FUTEX_TRYLOCK_PI`
84-
TrylockPi = bitcast!(c::FUTEX_TRYLOCK_PI),
85-
/// `FUTEX_WAIT_BITSET`
86-
WaitBitset = bitcast!(c::FUTEX_WAIT_BITSET),
87-
}
88-
8951
/// `FUTEX_WAITERS`
9052
pub const WAITERS: u32 = linux_raw_sys::general::FUTEX_WAITERS;
9153

src/backend/linux_raw/conv.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,17 +439,15 @@ pub(crate) mod fs {
439439
}
440440
}
441441

442-
#[cfg(any(feature = "fs", feature = "mount"))]
442+
#[cfg(feature = "mount")]
443443
impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MountFlagsArg> for ArgReg<'a, Num> {
444444
#[inline]
445445
fn from(flags: crate::backend::mount::types::MountFlagsArg) -> Self {
446446
c_uint(flags.0)
447447
}
448448
}
449449

450-
// When the deprecated "fs" aliases are removed, we can remove the "fs"
451-
// here too.
452-
#[cfg(any(feature = "fs", feature = "mount"))]
450+
#[cfg(feature = "mount")]
453451
impl<'a, Num: ArgNumber> From<crate::backend::mount::types::UnmountFlags> for ArgReg<'a, Num> {
454452
#[inline]
455453
fn from(flags: crate::backend::mount::types::UnmountFlags) -> Self {

src/backend/linux_raw/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ pub(crate) mod io_uring;
4747
pub(crate) mod mm;
4848
#[cfg(feature = "mount")]
4949
pub(crate) mod mount;
50-
#[cfg(all(feature = "fs", not(feature = "mount")))]
51-
pub(crate) mod mount; // for deprecated mount functions in "fs"
5250
#[cfg(feature = "net")]
5351
pub(crate) mod net;
5452
#[cfg(any(

src/backend/linux_raw/net/send_recv.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ bitflags! {
1616
const DONTROUTE = c::MSG_DONTROUTE;
1717
/// `MSG_DONTWAIT`
1818
const DONTWAIT = c::MSG_DONTWAIT;
19-
/// Deprecated alias for [`EOR`].
20-
///
21-
/// [`EOR`]: Self::EOR
22-
#[deprecated(note = "`rustix::net::SendFlags::EOT` is renamed to `rustix::net::SendFlags::EOR`.")]
23-
const EOT = c::MSG_EOR;
2419
/// `MSG_EOR`
2520
const EOR = c::MSG_EOR;
2621
/// `MSG_MORE`

src/backend/linux_raw/shm/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::backend::fs::syscalls::{open, unlink};
44
use crate::backend::fs::types::{Mode, OFlags};
55
use crate::fd::OwnedFd;
66
use crate::io;
7-
use crate::shm::ShmOFlags;
7+
use crate::shm;
88

99
const NAME_MAX: usize = 255;
1010
const SHM_DIR: &[u8] = b"/dev/shm/";
@@ -32,7 +32,7 @@ fn get_shm_name(name: &CStr) -> io::Result<([u8; NAME_MAX + SHM_DIR.len() + 1],
3232
Ok((path, SHM_DIR.len() + name.len() + 1))
3333
}
3434

35-
pub(crate) fn shm_open(name: &CStr, oflags: ShmOFlags, mode: Mode) -> io::Result<OwnedFd> {
35+
pub(crate) fn shm_open(name: &CStr, oflags: shm::OFlags, mode: Mode) -> io::Result<OwnedFd> {
3636
let (path, len) = get_shm_name(name)?;
3737
open(
3838
CStr::from_bytes_with_nul(&path[..len]).unwrap(),

0 commit comments

Comments
 (0)