Skip to content

Commit 85b0c2f

Browse files
committed
rustdoc: fixed messed-up rustdoc auto trait impls
Before: impl<T, U> UnwindSafe for (T, ...) where T: UnwindSafe, U: UnwindSafe, After: impl<T> UnwindSafe for (T, ...) where T: UnwindSafe,
1 parent 6950f14 commit 85b0c2f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

library/core/src/primitive_docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ mod prim_tuple {}
960960
// Required to make auto trait impls render.
961961
// See /src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls
962962
#[doc(hidden)]
963-
impl<T, U> (T, U) {}
963+
impl<T> (T,) {}
964964

965965
// Fake impl that's only really used for docs.
966966
#[cfg(doc)]

library/std/src/primitive_docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ mod prim_tuple {}
960960
// Required to make auto trait impls render.
961961
// See /src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls
962962
#[doc(hidden)]
963-
impl<T, U> (T, U) {}
963+
impl<T> (T,) {}
964964

965965
// Fake impl that's only really used for docs.
966966
#[cfg(doc)]

src/librustdoc/clean/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ pub(crate) enum PrimitiveType {
17501750
Never,
17511751
}
17521752

1753-
type SimplifiedTypes = FxHashMap<PrimitiveType, ArrayVec<SimplifiedType, 2>>;
1753+
type SimplifiedTypes = FxHashMap<PrimitiveType, ArrayVec<SimplifiedType, 3>>;
17541754
impl PrimitiveType {
17551755
pub(crate) fn from_hir(prim: hir::PrimTy) -> PrimitiveType {
17561756
use ast::{FloatTy, IntTy, UintTy};
@@ -1839,10 +1839,10 @@ impl PrimitiveType {
18391839
//
18401840
// Either manually update this arrayvec at this point
18411841
// or start with a more complex refactoring.
1842-
Tuple => [TupleSimplifiedType(2), TupleSimplifiedType(3)].into(),
1842+
Tuple => [TupleSimplifiedType(1), TupleSimplifiedType(2), TupleSimplifiedType(3)].into(),
18431843
Unit => single(TupleSimplifiedType(0)),
1844-
RawPointer => [PtrSimplifiedType(Mutability::Not), PtrSimplifiedType(Mutability::Mut)].into(),
1845-
Reference => [RefSimplifiedType(Mutability::Not), RefSimplifiedType(Mutability::Mut)].into(),
1844+
RawPointer => [PtrSimplifiedType(Mutability::Not), PtrSimplifiedType(Mutability::Mut)].into_iter().collect(),
1845+
Reference => [RefSimplifiedType(Mutability::Not), RefSimplifiedType(Mutability::Mut)].into_iter().collect(),
18461846
// FIXME: This will be wrong if we ever add inherent impls
18471847
// for function pointers.
18481848
Fn => ArrayVec::new(),

0 commit comments

Comments
 (0)