Skip to content

Commit 2bbf44f

Browse files
committed
rustdoc: change "variadic tuple" notation to look less like real syntax
1 parent 9439671 commit 2bbf44f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

library/core/src/primitive_docs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,10 @@ mod prim_str {}
918918
// linked to as `#trait-implementations-1`
919919
/// # Trait implementations
920920
///
921-
/// In this documentation the shorthand `(T, ...)` is used to represent tuples of varying length.
922-
/// When that is used, any trait bound expressed on `T` applies to each element of the tuple
923-
/// independently. Note that this is a convenience notation to avoid repetitive documentation,
924-
/// not valid Rust syntax.
921+
/// In this documentation the shorthand `(T₁, T₂, …, Tₙ)` is used to represent tuples of varying
922+
/// length. When that is used, any trait bound expressed on `T` applies to each element of the
923+
/// tuple independently. Note that this is a convenience notation to avoid repetitive
924+
/// documentation, not valid Rust syntax.
925925
///
926926
/// Due to a temporary restriction in Rust’s type system, the following traits are only
927927
/// implemented on tuples of arity 12 or less. In the future, this may change:

library/std/src/primitive_docs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,10 @@ mod prim_str {}
918918
// linked to as `#trait-implementations-1`
919919
/// # Trait implementations
920920
///
921-
/// In this documentation the shorthand `(T, ...)` is used to represent tuples of varying length.
922-
/// When that is used, any trait bound expressed on `T` applies to each element of the tuple
923-
/// independently. Note that this is a convenience notation to avoid repetitive documentation,
924-
/// not valid Rust syntax.
921+
/// In this documentation the shorthand `(T₁, T₂, …, Tₙ)` is used to represent tuples of varying
922+
/// length. When that is used, any trait bound expressed on `T` applies to each element of the
923+
/// tuple independently. Note that this is a convenience notation to avoid repetitive
924+
/// documentation, not valid Rust syntax.
925925
///
926926
/// Due to a temporary restriction in Rust’s type system, the following traits are only
927927
/// implemented on tuples of arity 12 or less. In the future, this may change:

src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ impl clean::Impl {
10791079
(self.kind.is_tuple_variadic() || self.kind.is_auto()) {
10801080
// Hardcoded anchor library/core/src/primitive_docs.rs
10811081
// Link should match `# Trait implementations`
1082-
primitive_link_fragment(f, PrimitiveType::Tuple, &format!("({name}, ...)"), "#trait-implementations-1", cx)?;
1082+
primitive_link_fragment(f, PrimitiveType::Tuple, &format!("({name}₁, {name}₂, …, {name}ₙ)"), "#trait-implementations-1", cx)?;
10831083
} else if let Some(ty) = self.kind.as_blanket_ty() {
10841084
fmt_type(ty, f, use_absolute, cx)?;
10851085
} else {

0 commit comments

Comments
 (0)