Skip to content

Commit 1ef48b1

Browse files
Update rustdoc tests
1 parent 2fbbf9a commit 1ef48b1

11 files changed

+20
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<code>pub fn delta&lt;T&gt;() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;[T; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]&gt;</code>
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.array.html">[T; 1]</a>&gt;</code>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +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.u32.html">u32</a>; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]&gt;</code>
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.u32.html">u32</a>; 1]&gt;</code>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<code>pub fn beta&lt;T&gt;() -&gt; &amp;'static [T; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]</code>
1+
<code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="{{channel}}/core/primitive.array.html">[T; 1]</a></code>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]</code>
1+
<code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>; 1]</code>

tests/rustdoc/primitive-links.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
pub struct Struct;
99

1010
pub trait Trait<Rhs = Self> {
11-
// There should only be one `<a>` (not linking to reference primitive).
12-
// @count - '//*[@id="tymethod.method"]/*[@class="code-header"]/a' 1
11+
// @count - '//*[@id="tymethod.method"]/*[@class="code-header"]/a' 2
1312
// @has - '//*[@id="tymethod.method"]/*[@class="code-header"]/a' 'method'
13+
// @has - '//*[@id="tymethod.method"]/*[@class="code-header"]/a' '&'
1414
fn method(&self, other: &Rhs);
15-
// There should only be one `<a>` (method and `*const`).
1615
// @count - '//*[@id="tymethod.method2"]/*[@class="code-header"]/a' 2
1716
// @has - '//*[@id="tymethod.method2"]/*[@class="code-header"]/a' 'method2'
1817
// @has - '//*[@id="tymethod.method2"]/*[@class="code-header"]/a' '*const'
@@ -41,24 +40,25 @@ pub trait Trait<Rhs = Self> {
4140
// @has - '//*[@id="tymethod.tuple2"]/*[@class="code-header"]/a' 'tuple2'
4241
// @has - '//*[@id="tymethod.tuple2"]/*[@class="code-header"]/a' 'Struct'
4342
fn tuple2(&self, other: (Struct, Rhs));
44-
// There should be only one `<a>` (just the method).
45-
// @count - '//*[@id="tymethod.slice"]/*[@class="code-header"]/a' 1
43+
// @count - '//*[@id="tymethod.slice"]/*[@class="code-header"]/a' 2
4644
// @has - '//*[@id="tymethod.slice"]/*[@class="code-header"]/a' 'slice'
45+
// @has - '//*[@id="tymethod.slice"]/*[@class="code-header"]/a' '&[Rhs]'
4746
fn slice(&self, other: &[Rhs]);
47+
// @count - '//*[@id="tymethod.ref_array"]/*[@class="code-header"]/a' 2
48+
// @has - '//*[@id="tymethod.ref_array"]/*[@class="code-header"]/a' 'ref_array'
49+
// @has - '//*[@id="tymethod.ref_array"]/*[@class="code-header"]/a' '[Rhs; 2]'
50+
fn ref_array(&self, other: &[Rhs; 2]);
4851
// There should be two `<a>` (method and `Struct`).
4952
// @count - '//*[@id="tymethod.slice2"]/*[@class="code-header"]/a' 2
5053
// @has - '//*[@id="tymethod.slice2"]/*[@class="code-header"]/a' 'slice2'
5154
// @has - '//*[@id="tymethod.slice2"]/*[@class="code-header"]/a' 'Struct'
5255
fn slice2(&self, other: &[Struct]);
53-
// There should be two `<a>` (the method and one for the array primitive).
5456
// @count - '//*[@id="tymethod.array"]/*[@class="code-header"]/a' 2
5557
// @has - '//*[@id="tymethod.array"]/*[@class="code-header"]/a' 'array'
56-
// @has - '//*[@id="tymethod.array"]/*[@class="code-header"]/a' '2'
58+
// @has - '//*[@id="tymethod.array"]/*[@class="code-header"]/a' '[Rhs; 2]'
5759
fn array(&self, other: [Rhs; 2]);
58-
// There should be two `<a>` (method, `Struct` and array primitive).
59-
// @count - '//*[@id="tymethod.array2"]/*[@class="code-header"]/a' 3
60+
// @count - '//*[@id="tymethod.array2"]/*[@class="code-header"]/a' 2
6061
// @has - '//*[@id="tymethod.array2"]/*[@class="code-header"]/a' 'array2'
6162
// @has - '//*[@id="tymethod.array2"]/*[@class="code-header"]/a' 'Struct'
62-
// @has - '//*[@id="tymethod.array2"]/*[@class="code-header"]/a' '2'
6363
fn array2(&self, other: [Struct; 2]);
6464
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<code>pub fn delta&lt;T&gt;() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;[T]&gt;</code>
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>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<code>pub fn beta&lt;T&gt;() -&gt; &amp;'static [T]</code>
1+
<code>pub fn beta&lt;T&gt;() -&gt; <a class="primitive" href="{{channel}}/core/primitive.slice.html">&amp;'static [T]</a></code>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<pre class="rust item-decl"><code>pub enum Cow&lt;'a, B&gt;<span class="where fmt-newline">where
22
B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a,</span>{
3-
Borrowed(&amp;'a B),
3+
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B),
44
Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
55
}</code></pre>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<pre class="rust item-decl"><code>pub enum Cow2&lt;'a, B: ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
2-
Borrowed(&amp;'a B),
2+
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B),
33
Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
44
}</code></pre>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<pre class="rust item-decl"><code>pub struct Struct&lt;'a, B&gt;<span class="where fmt-newline">where
22
B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a,</span>{
3-
pub a: &amp;'a B,
3+
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B,
44
pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
55
}</code></pre>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<pre class="rust item-decl"><code>pub struct Struct2&lt;'a, B: ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
2-
pub a: &amp;'a B,
2+
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B,
33
pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
44
}</code></pre>

0 commit comments

Comments
 (0)