Skip to content

Commit

Permalink
Add cfgs to fix compilation in more situations.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Nov 30, 2023
1 parent 33acaa9 commit b2b253f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/backend/linux_raw/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use super::c;
use super::fd::{AsRawFd, BorrowedFd, FromRawFd, RawFd};
#[cfg(feature = "runtime")]
#[cfg(any(feature = "event", feature = "runtime"))]
use super::io::errno::try_decode_error;
#[cfg(target_pointer_width = "64")]
use super::io::errno::try_decode_u64;
Expand Down Expand Up @@ -874,7 +874,7 @@ pub(super) unsafe fn ret(raw: RetReg<R0>) -> io::Result<()> {
///
/// The caller must ensure that this is the return value of a syscall which
/// doesn't return on success.
#[cfg(feature = "runtime")]
#[cfg(any(feature = "event", feature = "runtime"))]
#[inline]
pub(super) unsafe fn ret_error(raw: RetReg<R0>) -> io::Errno {
try_decode_error(raw)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/linux_raw/io/errno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub(in crate::backend) unsafe fn try_decode_void<Num: RetNumber>(
/// # Safety
///
/// This must only be used with syscalls which do not return on success.
#[cfg(feature = "runtime")]
#[cfg(any(feature = "event", feature = "runtime"))]
#[inline]
pub(in crate::backend) unsafe fn try_decode_error<Num: RetNumber>(raw: RetReg<Num>) -> io::Errno {
debug_assert!(raw.is_in_range(-4095..0));
Expand Down
1 change: 1 addition & 0 deletions tests/net/cmsg.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(feature = "pipe")]
#[test]
fn test_empty_buffers() {
use rustix::fd::AsFd;
Expand Down

0 comments on commit b2b253f

Please sign in to comment.