mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Add test case for #trait-implementations-1 link
This commit is contained in:
parent
3fd16648fe
commit
c1487550ca
@ -914,6 +914,8 @@ mod prim_str {}
|
||||
///
|
||||
/// For more about tuples, see [the book](../book/ch03-02-data-types.html#the-tuple-type).
|
||||
///
|
||||
// Hardcoded anchor in src/librustdoc/html/format.rs
|
||||
// linked to as `#trait-implementations-1`
|
||||
/// # Trait implementations
|
||||
///
|
||||
/// In this documentation the shorthand `(T, ...)` is used to represent tuples of varying length.
|
||||
|
@ -914,6 +914,8 @@ mod prim_str {}
|
||||
///
|
||||
/// For more about tuples, see [the book](../book/ch03-02-data-types.html#the-tuple-type).
|
||||
///
|
||||
// Hardcoded anchor in src/librustdoc/html/format.rs
|
||||
// linked to as `#trait-implementations-1`
|
||||
/// # Trait implementations
|
||||
///
|
||||
/// In this documentation the shorthand `(T, ...)` is used to represent tuples of varying length.
|
||||
|
@ -1077,6 +1077,8 @@ impl clean::Impl {
|
||||
if let clean::Type::Tuple(types) = &self.for_ &&
|
||||
let [clean::Type::Generic(name)] = &types[..] &&
|
||||
(self.kind.is_tuple_variadic() || self.kind.is_auto()) {
|
||||
// Hardcoded anchor library/core/src/primitive_docs.rs
|
||||
// Link should match `# Trait implementations`
|
||||
primitive_link_fragment(f, PrimitiveType::Tuple, &format!("({name}, ...)"), "#trait-implementations-1", cx)?;
|
||||
} else if let Some(ty) = self.kind.as_blanket_ty() {
|
||||
fmt_type(ty, f, use_absolute, cx)?;
|
||||
|
@ -11,4 +11,12 @@
|
||||
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Sync'
|
||||
#[doc(primitive = "tuple")]
|
||||
/// this is a test!
|
||||
///
|
||||
// Hardcoded anchor to header written in library/core/src/primitive_docs.rs
|
||||
// @has - '//h2[@id="trait-implementations-1"]' 'Trait implementations'
|
||||
/// # Trait implementations
|
||||
///
|
||||
/// This header is hard-coded in the HTML format linking for `#[doc(tuple_variadics)]`.
|
||||
/// To make sure it gets linked correctly, we need to make sure the hardcoded anchor
|
||||
/// in the code matches what rustdoc generates for the header.
|
||||
mod tuple_prim {}
|
||||
|
Loading…
Reference in New Issue
Block a user