docs: show Clone and Copy on () doc pages

This commit is contained in:
Michael Howell 2022-06-07 12:12:49 -07:00
parent 1e6a85789e
commit 7a93567005
4 changed files with 68 additions and 2 deletions

View file

@ -444,6 +444,22 @@ mod prim_unit {}
#[doc(hidden)]
impl () {}
// Fake impl that's only really used for docs.
#[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")]
impl Clone for () {
fn clone(&self) -> Self {
loop {}
}
}
// Fake impl that's only really used for docs.
#[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")]
impl Copy for () {
// empty
}
#[doc(primitive = "pointer")]
#[doc(alias = "ptr")]
#[doc(alias = "*")]
@ -959,6 +975,24 @@ mod prim_tuple {}
#[doc(hidden)]
impl<T, U> (T, U) {}
// Fake impl that's only really used for docs.
#[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")]
/// This trait is implemented on arbitrary-length tuples.
impl<T: Clone> Clone for (T,) {
fn clone(&self) -> Self {
loop {}
}
}
// Fake impl that's only really used for docs.
#[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")]
/// This trait is implemented on arbitrary-length tuples.
impl<T: Copy> Copy for (T,) {
// empty
}
#[doc(primitive = "f32")]
/// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008).
///