Skip to content

Commit 2d22259

Browse files
committed
UniqueRc: platform-specific AsFd/Handle/etc impls to mirror Rc
1 parent dbd3504 commit 2d22259

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

library/std/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@
378378
#![feature(thin_box)]
379379
#![feature(try_reserve_kind)]
380380
#![feature(try_with_capacity)]
381+
#![feature(unique_rc_arc)]
381382
#![feature(vec_into_raw_parts)]
382383
// tidy-alphabetical-end
383384
//

library/std/src/os/fd/owned.rs

+8
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ impl<T: AsFd + ?Sized> AsFd for crate::rc::Rc<T> {
427427
}
428428
}
429429

430+
#[unstable(feature = "unique_rc_arc", issue = "112566")]
431+
impl<T: AsFd + ?Sized> AsFd for crate::rc::UniqueRc<T> {
432+
#[inline]
433+
fn as_fd(&self) -> BorrowedFd<'_> {
434+
(**self).as_fd()
435+
}
436+
}
437+
430438
#[stable(feature = "asfd_ptrs", since = "1.64.0")]
431439
impl<T: AsFd + ?Sized> AsFd for Box<T> {
432440
#[inline]

library/std/src/os/fd/raw.rs

+8
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ impl<T: AsRawFd> AsRawFd for crate::rc::Rc<T> {
266266
}
267267
}
268268

269+
#[unstable(feature = "unique_rc_arc", issue = "112566")]
270+
impl<T: AsRawFd + ?Sized> AsRawFd for crate::rc::UniqueRc<T> {
271+
#[inline]
272+
fn as_raw_fd(&self) -> RawFd {
273+
(**self).as_raw_fd()
274+
}
275+
}
276+
269277
#[stable(feature = "asrawfd_ptrs", since = "1.63.0")]
270278
impl<T: AsRawFd> AsRawFd for Box<T> {
271279
#[inline]

library/std/src/os/windows/io/handle.rs

+8
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,14 @@ impl<T: AsHandle + ?Sized> AsHandle for crate::rc::Rc<T> {
485485
}
486486
}
487487

488+
#[unstable(feature = "unique_rc_arc", issue = "112566")]
489+
impl<T: AsHandle + ?Sized> AsHandle for crate::rc::UniqueRc<T> {
490+
#[inline]
491+
fn as_handle(&self) -> BorrowedHandle<'_> {
492+
(**self).as_handle()
493+
}
494+
}
495+
488496
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
489497
impl<T: AsHandle + ?Sized> AsHandle for Box<T> {
490498
#[inline]

library/std/src/os/windows/io/socket.rs

+8
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,14 @@ impl<T: AsSocket> AsSocket for crate::rc::Rc<T> {
279279
}
280280
}
281281

282+
#[unstable(feature = "unique_rc_arc", issue = "112566")]
283+
impl<T: AsSocket + ?Sized> AsSocket for crate::rc::UniqueRc<T> {
284+
#[inline]
285+
fn as_socket(&self) -> BorrowedSocket<'_> {
286+
(**self).as_socket()
287+
}
288+
}
289+
282290
#[stable(feature = "as_windows_ptrs", since = "1.71.0")]
283291
impl<T: AsSocket> AsSocket for Box<T> {
284292
#[inline]

0 commit comments

Comments
 (0)