Skip to content

Commit

Permalink
Unrolled build for rust-lang#114655
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#114655 - nbdd0121:io-safety, r=dtolnay

Make `impl<Fd: AsFd>` impl take `?Sized`

`@rustbot` labels: +T-libs-api +needs-fcp
  • Loading branch information
rust-timer authored Mar 9, 2024
2 parents 25ee3c6 + f4aeb70 commit 3770492
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions library/std/src/os/fd/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ pub trait AsFd {
}

#[stable(feature = "io_safety", since = "1.63.0")]
impl<T: AsFd> AsFd for &T {
impl<T: AsFd + ?Sized> AsFd for &T {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
T::as_fd(self)
}
}

#[stable(feature = "io_safety", since = "1.63.0")]
impl<T: AsFd> AsFd for &mut T {
impl<T: AsFd + ?Sized> AsFd for &mut T {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
T::as_fd(self)
Expand Down Expand Up @@ -402,23 +402,23 @@ impl From<OwnedFd> for crate::net::UdpSocket {
/// impl MyTrait for Box<UdpSocket> {}
/// # }
/// ```
impl<T: AsFd> AsFd for crate::sync::Arc<T> {
impl<T: AsFd + ?Sized> AsFd for crate::sync::Arc<T> {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
(**self).as_fd()
}
}

#[stable(feature = "asfd_rc", since = "1.69.0")]
impl<T: AsFd> AsFd for crate::rc::Rc<T> {
impl<T: AsFd + ?Sized> AsFd for crate::rc::Rc<T> {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
(**self).as_fd()
}
}

#[stable(feature = "asfd_ptrs", since = "1.64.0")]
impl<T: AsFd> AsFd for Box<T> {
impl<T: AsFd + ?Sized> AsFd for Box<T> {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
(**self).as_fd()
Expand Down
10 changes: 5 additions & 5 deletions library/std/src/os/windows/io/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,15 @@ pub trait AsHandle {
}

#[stable(feature = "io_safety", since = "1.63.0")]
impl<T: AsHandle> AsHandle for &T {
impl<T: AsHandle + ?Sized> AsHandle for &T {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
T::as_handle(self)
}
}

#[stable(feature = "io_safety", since = "1.63.0")]
impl<T: AsHandle> AsHandle for &mut T {
impl<T: AsHandle + ?Sized> AsHandle for &mut T {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
T::as_handle(self)
Expand All @@ -450,23 +450,23 @@ impl<T: AsHandle> AsHandle for &mut T {
/// impl MyTrait for Box<File> {}
/// # }
/// ```
impl<T: AsHandle> AsHandle for crate::sync::Arc<T> {
impl<T: AsHandle + ?Sized> AsHandle for crate::sync::Arc<T> {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
(**self).as_handle()
}
}

#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
impl<T: AsHandle> AsHandle for crate::rc::Rc<T> {
impl<T: AsHandle + ?Sized> AsHandle for crate::rc::Rc<T> {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
(**self).as_handle()
}
}

#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
impl<T: AsHandle> AsHandle for Box<T> {
impl<T: AsHandle + ?Sized> AsHandle for Box<T> {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
(**self).as_handle()
Expand Down

0 comments on commit 3770492

Please sign in to comment.