about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-06-03 11:18:27 +0200
committerGitHub <noreply@github.com>2022-06-03 11:18:27 +0200
commitd6f35b3454376183b80f67fbbebebbca20d4e7bc (patch)
tree155208948fc06c15c3eb1ad060948a3452eca06f /src/test/rustdoc
parentb71ddd68619b417272f77a89b5eab04f6bc64534 (diff)
parentdadf3bdefff6c38d7f64d7ae4b14fbaca66ab96a (diff)
downloadrust-d6f35b3454376183b80f67fbbebebbca20d4e7bc.tar.gz
rust-d6f35b3454376183b80f67fbbebebbca20d4e7bc.zip
Rollup merge of #97668 - notriddle:notriddle/slice-link, r=jsha
rustdoc: clean up primitive.slice.html links

Before: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a>&lt;<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[</a>T<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">]</a>&gt;

After: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a>&lt;<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[T]</a>&gt;
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/slice-links.link_box_generic.html1
-rw-r--r--src/test/rustdoc/slice-links.link_box_u32.html1
-rw-r--r--src/test/rustdoc/slice-links.link_slice_generic.html1
-rw-r--r--src/test/rustdoc/slice-links.link_slice_u32.html1
-rw-r--r--src/test/rustdoc/slice-links.rs28
5 files changed, 32 insertions, 0 deletions
diff --git a/src/test/rustdoc/slice-links.link_box_generic.html b/src/test/rustdoc/slice-links.link_box_generic.html
new file mode 100644
index 00000000000..38aaf20808c
--- /dev/null
+++ b/src/test/rustdoc/slice-links.link_box_generic.html
@@ -0,0 +1 @@
+<code>pub fn delta&lt;T&gt;() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;<a class="primitive" href="{{channel}}/core/primitive.slice.html">[T]</a>&gt;</code>
\ No newline at end of file
diff --git a/src/test/rustdoc/slice-links.link_box_u32.html b/src/test/rustdoc/slice-links.link_box_u32.html
new file mode 100644
index 00000000000..42fd721a4ac
--- /dev/null
+++ b/src/test/rustdoc/slice-links.link_box_u32.html
@@ -0,0 +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
diff --git a/src/test/rustdoc/slice-links.link_slice_generic.html b/src/test/rustdoc/slice-links.link_slice_generic.html
new file mode 100644
index 00000000000..fe79ca7a82d
--- /dev/null
+++ b/src/test/rustdoc/slice-links.link_slice_generic.html
@@ -0,0 +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
diff --git a/src/test/rustdoc/slice-links.link_slice_u32.html b/src/test/rustdoc/slice-links.link_slice_u32.html
new file mode 100644
index 00000000000..c7e430b0607
--- /dev/null
+++ b/src/test/rustdoc/slice-links.link_slice_u32.html
@@ -0,0 +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
diff --git a/src/test/rustdoc/slice-links.rs b/src/test/rustdoc/slice-links.rs
new file mode 100644
index 00000000000..9a78e963e30
--- /dev/null
+++ b/src/test/rustdoc/slice-links.rs
@@ -0,0 +1,28 @@
+#![crate_name = "foo"]
+#![no_std]
+
+pub struct MyBox<T: ?Sized>(*const T);
+
+// @has 'foo/fn.alpha.html'
+// @snapshot link_slice_u32 - '//pre[@class="rust fn"]/code'
+pub fn alpha() -> &'static [u32] {
+    loop {}
+}
+
+// @has 'foo/fn.beta.html'
+// @snapshot link_slice_generic - '//pre[@class="rust fn"]/code'
+pub fn beta<T>() -> &'static [T] {
+    loop {}
+}
+
+// @has 'foo/fn.gamma.html'
+// @snapshot link_box_u32 - '//pre[@class="rust fn"]/code'
+pub fn gamma() -> MyBox<[u32]> {
+    loop {}
+}
+
+// @has 'foo/fn.delta.html'
+// @snapshot link_box_generic - '//pre[@class="rust fn"]/code'
+pub fn delta<T>() -> MyBox<[T]> {
+    loop {}
+}