Skip to content

Commit 53b0ed1

Browse files
committed
Fix cfg conditionals for io_lifetimes_use_std.
1 parent 80532f9 commit 53b0ed1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/traits.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,25 @@ pub trait FromSocket {
219219
}
220220
}
221221

222-
#[cfg(not(windows))]
222+
#[cfg(not(io_lifetimes_use_std))]
223+
#[cfg(any(unix, target_os = "wasi"))]
223224
impl<T: AsFd> AsFd for &T {
224225
#[inline]
225226
fn as_fd(&self) -> BorrowedFd<'_> {
226227
T::as_fd(self)
227228
}
228229
}
229230

230-
#[cfg(not(windows))]
231+
#[cfg(not(io_lifetimes_use_std))]
232+
#[cfg(any(unix, target_os = "wasi"))]
231233
impl<T: AsFd> AsFd for &mut T {
232234
#[inline]
233235
fn as_fd(&self) -> BorrowedFd<'_> {
234236
T::as_fd(self)
235237
}
236238
}
237239

240+
#[cfg(not(io_lifetimes_use_std))]
238241
#[cfg(windows)]
239242
impl<T: AsHandle> AsHandle for &T {
240243
#[inline]
@@ -243,6 +246,7 @@ impl<T: AsHandle> AsHandle for &T {
243246
}
244247
}
245248

249+
#[cfg(not(io_lifetimes_use_std))]
246250
#[cfg(windows)]
247251
impl<T: AsHandle> AsHandle for &mut T {
248252
#[inline]
@@ -251,6 +255,7 @@ impl<T: AsHandle> AsHandle for &mut T {
251255
}
252256
}
253257

258+
#[cfg(not(io_lifetimes_use_std))]
254259
#[cfg(windows)]
255260
impl<T: AsSocket> AsSocket for &T {
256261
#[inline]
@@ -259,6 +264,7 @@ impl<T: AsSocket> AsSocket for &T {
259264
}
260265
}
261266

267+
#[cfg(not(io_lifetimes_use_std))]
262268
#[cfg(windows)]
263269
impl<T: AsSocket> AsSocket for &mut T {
264270
#[inline]

0 commit comments

Comments
 (0)