Skip to content

Commit f4aeb70

Browse files
committed
Make impl<T: AsHandle> impl take ?Sized
1 parent 8ea2922 commit f4aeb70

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,15 @@ pub trait AsHandle {
422422
}
423423

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

432432
#[stable(feature = "io_safety", since = "1.63.0")]
433-
impl<T: AsHandle> AsHandle for &mut T {
433+
impl<T: AsHandle + ?Sized> AsHandle for &mut T {
434434
#[inline]
435435
fn as_handle(&self) -> BorrowedHandle<'_> {
436436
T::as_handle(self)
@@ -450,23 +450,23 @@ impl<T: AsHandle> AsHandle for &mut T {
450450
/// impl MyTrait for Box<File> {}
451451
/// # }
452452
/// ```
453-
impl<T: AsHandle> AsHandle for crate::sync::Arc<T> {
453+
impl<T: AsHandle + ?Sized> AsHandle for crate::sync::Arc<T> {
454454
#[inline]
455455
fn as_handle(&self) -> BorrowedHandle<'_> {
456456
(**self).as_handle()
457457
}
458458
}
459459

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

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

0 commit comments

Comments
 (0)