Skip to content

Commit 58d21d0

Browse files
zachs18gitbot
authored and
gitbot
committed
UniqueRc: platform-specific AsFd/Handle/etc impls to mirror Rc
1 parent 426e9e2 commit 58d21d0

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

std/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
#![feature(thin_box)]
374374
#![feature(try_reserve_kind)]
375375
#![feature(try_with_capacity)]
376+
#![feature(unique_rc_arc)]
376377
#![feature(vec_into_raw_parts)]
377378
// tidy-alphabetical-end
378379
//

std/src/os/fd/owned.rs

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

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

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]

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]

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)