Skip to content

Commit b858a47

Browse files
Update existing snapshot and add more snapshots of where clause indentation
1 parent 9202caa commit b858a47

7 files changed

+20
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h3 class="code-header">impl&lt;D&gt; <a class="struct" href="struct.Delta.html" title="struct foo::Delta">Delta</a>&lt;D&gt;<span class="where fmt-newline">where
2+
D: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></h3>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<pre class="rust item-decl"><code>pub struct Simd&lt;T&gt;(_)
22
<span class="where">where
3-
T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>
3+
T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<code>pub struct Alpha&lt;A&gt;(_)
2+
<span class="where">where
3+
A: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<code>pub trait Bravo&lt;B&gt;<span class="where fmt-newline">where
2+
B: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span>{
3+
// Required method
4+
fn <a href="#tymethod.get" class="fn">get</a>(&amp;self, B: B);
5+
}</code>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<code>pub fn charlie&lt;C&gt;()<span class="where fmt-newline">where
2+
C: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></code>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<code>pub type Golf&lt;T&gt;<span class="where fmt-newline">where
2+
T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span> = <a class="primitive" href="{{channel}}/std/primitive.tuple.html">(T, T)</a>;</code>

tests/rustdoc/where.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ use std::io::Lines;
55
pub trait MyTrait { fn dummy(&self) { } }
66

77
// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
8+
// @snapshot alpha_trait_decl - '//*[@class="rust item-decl"]/code'
89
pub struct Alpha<A>(A) where A: MyTrait;
910
// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait"
11+
// @snapshot bravo_trait_decl - '//*[@class="rust item-decl"]/code'
1012
pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
1113
// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait"
14+
// @snapshot charlie_fn_decl - '//*[@class="rust item-decl"]/code'
1215
pub fn charlie<C>() where C: MyTrait {}
1316

1417
pub struct Delta<D>(D);
1518

1619
// @has foo/struct.Delta.html '//*[@class="impl"]//h3[@class="code-header"]' \
1720
// "impl<D> Delta<D>where D: MyTrait"
21+
// @snapshot SWhere_Echo_impl - '//*[@id="impl-Delta%3CD%3E"]/h3[@class="code-header"]'
1822
impl<D> Delta<D> where D: MyTrait {
1923
pub fn delta() {}
2024
}
@@ -65,4 +69,5 @@ impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}
6569

6670
// @has foo/type.Golf.html '//pre[@class="rust item-decl"]' \
6771
// "type Golf<T>where T: Clone, = (T, T)"
72+
// @snapshot golf_type_alias_decl - '//*[@class="rust item-decl"]/code'
6873
pub type Golf<T> where T: Clone = (T, T);

0 commit comments

Comments
 (0)