mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Implement AsFd
and AsRawFd
for Rc
Fixes https://github.com/rust-lang/rust/issues/105931.
This commit is contained in:
parent
40fda7b3fe
commit
c13669e00b
@ -396,6 +396,14 @@ impl<T: AsFd> AsFd for crate::sync::Arc<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "asfd_rc", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl<T: AsFd> 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> {
|
||||
#[inline]
|
||||
|
@ -244,6 +244,14 @@ impl<T: AsRawFd> AsRawFd for crate::sync::Arc<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "asfd_rc", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl<T: AsRawFd> AsRawFd for crate::rc::Rc<T> {
|
||||
#[inline]
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
(**self).as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "asrawfd_ptrs", since = "1.63.0")]
|
||||
impl<T: AsRawFd> AsRawFd for Box<T> {
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user