Skip to content

Commit 6397a4e

Browse files
committed
prevent TrivialClone implementations from appearing in rustdoc output
1 parent 08b0ee4 commit 6397a4e

File tree

12 files changed

+16
-0
lines changed

12 files changed

+16
-0
lines changed

core/src/array/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ impl<T: Clone, const N: usize> Clone for [T; N] {
452452
}
453453
}
454454

455+
#[doc(hidden)]
455456
#[unstable(feature = "trivial_clone", issue = "none")]
456457
unsafe impl<T: TrivialClone, const N: usize> TrivialClone for [T; N] {}
457458

core/src/clone.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ mod impls {
616616
}
617617
}
618618

619+
#[doc(hidden)]
619620
#[unstable(feature = "trivial_clone", issue = "none")]
620621
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
621622
unsafe impl const TrivialClone for $t {}
@@ -639,6 +640,7 @@ mod impls {
639640
}
640641
}
641642

643+
#[doc(hidden)]
642644
#[unstable(feature = "trivial_clone", issue = "none")]
643645
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
644646
unsafe impl const TrivialClone for ! {}
@@ -652,6 +654,7 @@ mod impls {
652654
}
653655
}
654656

657+
#[doc(hidden)]
655658
#[unstable(feature = "trivial_clone", issue = "none")]
656659
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
657660
unsafe impl<T: PointeeSized> const TrivialClone for *const T {}
@@ -665,6 +668,7 @@ mod impls {
665668
}
666669
}
667670

671+
#[doc(hidden)]
668672
#[unstable(feature = "trivial_clone", issue = "none")]
669673
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
670674
unsafe impl<T: PointeeSized> const TrivialClone for *mut T {}
@@ -680,6 +684,7 @@ mod impls {
680684
}
681685
}
682686

687+
#[doc(hidden)]
683688
#[unstable(feature = "trivial_clone", issue = "none")]
684689
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
685690
unsafe impl<T: PointeeSized> const TrivialClone for &T {}

core/src/marker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ impl<T: PointeeSized> Clone for PhantomData<T> {
858858
}
859859
}
860860

861+
#[doc(hidden)]
861862
#[unstable(feature = "trivial_clone", issue = "none")]
862863
unsafe impl<T: ?Sized> TrivialClone for PhantomData<T> {}
863864

core/src/marker/variance.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ macro_rules! phantom_type {
6161

6262
impl<T> Copy for $name<T> where T: ?Sized {}
6363

64+
#[doc(hidden)]
6465
unsafe impl<T> TrivialClone for $name<T> where T: ?Sized {}
6566

6667
impl<T> PartialEq for $name<T>

core/src/mem/maybe_uninit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ impl<T: Copy> Clone for MaybeUninit<T> {
358358
}
359359

360360
// SAFETY: the clone implementation is a copy, see above.
361+
#[doc(hidden)]
361362
#[unstable(feature = "trivial_clone", issue = "none")]
362363
unsafe impl<T> TrivialClone for MaybeUninit<T> where MaybeUninit<T>: Clone {}
363364

core/src/mem/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,7 @@ impl<T> clone::Clone for Discriminant<T> {
10711071
}
10721072
}
10731073

1074+
#[doc(hidden)]
10741075
#[unstable(feature = "trivial_clone", issue = "none")]
10751076
unsafe impl<T> TrivialClone for Discriminant<T> {}
10761077

core/src/num/nonzero.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ impl<T> UseCloned for NonZero<T> where T: ZeroablePrimitive {}
199199
#[stable(feature = "nonzero", since = "1.28.0")]
200200
impl<T> Copy for NonZero<T> where T: ZeroablePrimitive {}
201201

202+
#[doc(hidden)]
202203
#[unstable(feature = "trivial_clone", issue = "none")]
203204
unsafe impl<T> TrivialClone for NonZero<T> where T: ZeroablePrimitive {}
204205

core/src/option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,7 @@ where
22162216
#[unstable(feature = "ergonomic_clones", issue = "132290")]
22172217
impl<T> crate::clone::UseCloned for Option<T> where T: crate::clone::UseCloned {}
22182218

2219+
#[doc(hidden)]
22192220
#[unstable(feature = "trivial_clone", issue = "none")]
22202221
#[rustc_const_unstable(feature = "const_clone", issue = "142757")]
22212222
unsafe impl<T> const TrivialClone for Option<T> where T: [const] TrivialClone + [const] Destruct {}

core/src/ptr/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ impl<Dyn: PointeeSized> Clone for DynMetadata<Dyn> {
232232
}
233233
}
234234

235+
#[doc(hidden)]
235236
unsafe impl<Dyn: ?Sized> TrivialClone for DynMetadata<Dyn> {}
236237

237238
impl<Dyn: PointeeSized> Eq for DynMetadata<Dyn> {}

core/src/ptr/non_null.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,7 @@ impl<T: PointeeSized> Clone for NonNull<T> {
16541654
#[stable(feature = "nonnull", since = "1.25.0")]
16551655
impl<T: PointeeSized> Copy for NonNull<T> {}
16561656

1657+
#[doc(hidden)]
16571658
#[unstable(feature = "trivial_clone", issue = "none")]
16581659
unsafe impl<T: ?Sized> TrivialClone for NonNull<T> {}
16591660

0 commit comments

Comments
 (0)