diff options
| -rw-r--r-- | src/librustdoc/html/format.rs | 29 | ||||
| -rw-r--r-- | src/test/rustdoc/slice-links.link_box_u32.html | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/slice-links.link_slice_generic.html | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/slice-links.link_slice_u32.html | 2 |
4 files changed, 5 insertions, 30 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index b7789493df6..394db2d0cda 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -886,9 +886,9 @@ fn fmt_type<'cx>( primitive_link(f, PrimitiveType::Slice, &format!("[{name}]"), cx) } _ => { - primitive_link(f, PrimitiveType::Slice, "[", cx)?; + write!(f, "[")?; fmt::Display::fmt(&t.print(cx), f)?; - primitive_link(f, PrimitiveType::Slice, "]", cx) + write!(f, "]") } }, clean::Array(ref t, ref n) => { @@ -926,31 +926,6 @@ fn fmt_type<'cx>( let m = mutability.print_with_space(); let amp = if f.alternate() { "&".to_string() } else { "&".to_string() }; match **ty { - clean::Slice(ref bt) => { - // `BorrowedRef{ ... Slice(T) }` is `&[T]` - match **bt { - clean::Generic(name) => primitive_link( - f, - PrimitiveType::Slice, - &format!("{amp}{lt}{m}[{name}]"), - cx, - ), - _ => { - primitive_link( - f, - PrimitiveType::Slice, - &format!("{}{}{}[", amp, lt, m), - cx, - )?; - if f.alternate() { - write!(f, "{:#}", bt.print(cx))?; - } else { - write!(f, "{}", bt.print(cx))?; - } - primitive_link(f, PrimitiveType::Slice, "]", cx) - } - } - } clean::DynTrait(ref bounds, ref trait_lt) if bounds.len() > 1 || trait_lt.is_some() => { diff --git a/src/test/rustdoc/slice-links.link_box_u32.html b/src/test/rustdoc/slice-links.link_box_u32.html index 42fd721a4ac..7bec7582df7 100644 --- a/src/test/rustdoc/slice-links.link_box_u32.html +++ b/src/test/rustdoc/slice-links.link_box_u32.html @@ -1 +1 @@ -<code>pub fn gamma() -> <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a><<a class="primitive" href="{{channel}}/core/primitive.slice.html">[</a><a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a><a class="primitive" href="{{channel}}/core/primitive.slice.html">]</a>></code> \ No newline at end of file +<code>pub fn gamma() -> <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a><[<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>]></code> \ No newline at end of file diff --git a/src/test/rustdoc/slice-links.link_slice_generic.html b/src/test/rustdoc/slice-links.link_slice_generic.html index fe79ca7a82d..1d0f2bf75a2 100644 --- a/src/test/rustdoc/slice-links.link_slice_generic.html +++ b/src/test/rustdoc/slice-links.link_slice_generic.html @@ -1 +1 @@ -<code>pub fn beta<T>() -> <a class="primitive" href="{{channel}}/core/primitive.slice.html">&'static [T]</a></code> \ No newline at end of file +<code>pub fn beta<T>() -> &'static <a class="primitive" href="{{channel}}/core/primitive.slice.html">[T]</a></code> \ No newline at end of file diff --git a/src/test/rustdoc/slice-links.link_slice_u32.html b/src/test/rustdoc/slice-links.link_slice_u32.html index c7e430b0607..c86d3830426 100644 --- a/src/test/rustdoc/slice-links.link_slice_u32.html +++ b/src/test/rustdoc/slice-links.link_slice_u32.html @@ -1 +1 @@ -<code>pub fn alpha() -> <a class="primitive" href="{{channel}}/core/primitive.slice.html">&'static [</a><a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a><a class="primitive" href="{{channel}}/core/primitive.slice.html">]</a></code> \ No newline at end of file +<code>pub fn alpha() -> &'static [<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>]</code> \ No newline at end of file |
