about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-06-13 12:56:01 -0700
committerMichael Howell <michael@notriddle.com>2022-06-13 13:16:01 -0700
commit682889fb06591c4245422b73b005c5d8ae2d0cad (patch)
treeb9633603ec056760f53930ba7587c32e4dc0d7f7 /src/test/rustdoc
parent083721a1a7365d3afe1521cd2661b2201aac0450 (diff)
downloadrust-682889fb06591c4245422b73b005c5d8ae2d0cad.tar.gz
rust-682889fb06591c4245422b73b005c5d8ae2d0cad.zip
rustdoc: remove link on slice brackets
Since #97668 was merged, the slice::get function now looks like this:

![image](https://user-images.githubusercontent.com/1593513/173430685-1dd2b275-2439-4392-b7d4-96bcb355a377.png)

That whole thing, `[T]`, is a single link to `primitive.slice.html`. This
definitely fixes it for this case, but it's not obvious what we should do for
slices of concrete types:

![image](https://user-images.githubusercontent.com/1593513/173430968-7eed1aec-b688-4f84-a492-9210aff0037a.png)

There are actually three links in that `[u8]`: the opening brace `[` is a
link to `primitive.slice.html`, the `u8` is a link to `primitive.u8.html`,
and the final `]` is a link to `primitive.slice.html`. This is a serious
[usability bug](https://usability.yale.edu/web-accessibility/articles/links):
the square braces are much too small for anyone who doesn't have perfect
motor control using mouse or touch, provide an excessive number of tab stops
for anyone using keyboard, and no visual indication whatsoever that they're
separate links.

Now that slices of generic types are linked, it seems reasonable to err on
the side of less clutter and stop linking concrete slices to the slice page.
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/slice-links.link_box_u32.html2
-rw-r--r--src/test/rustdoc/slice-links.link_slice_generic.html2
-rw-r--r--src/test/rustdoc/slice-links.link_slice_u32.html2
3 files changed, 3 insertions, 3 deletions
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() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;<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>&gt;</code>
\ No newline at end of file
+<code>pub fn gamma() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;[<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>]&gt;</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&lt;T&gt;() -&gt; <a class="primitive" href="{{channel}}/core/primitive.slice.html">&amp;'static [T]</a></code>
\ No newline at end of file
+<code>pub fn beta&lt;T&gt;() -&gt; &amp;'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() -&gt; <a class="primitive" href="{{channel}}/core/primitive.slice.html">&amp;'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() -&gt; &amp;'static [<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>]</code>
\ No newline at end of file