Update existing snapshot and add more snapshots of where clause indentation

This commit is contained in:
Guillaume Gomez 2023-06-22 17:39:23 +02:00
parent 9202caaec5
commit b858a4745c
7 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,2 @@
<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
D: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></h3>

View file

@ -1,3 +1,3 @@
<pre class="rust item-decl"><code>pub struct Simd&lt;T&gt;(_)
<span class="where">where
T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>
T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>

View file

@ -0,0 +1,3 @@
<code>pub struct Alpha&lt;A&gt;(_)
<span class="where">where
A: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code>

View file

@ -0,0 +1,5 @@
<code>pub trait Bravo&lt;B&gt;<span class="where fmt-newline">where
B: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span>{
// Required method
fn <a href="#tymethod.get" class="fn">get</a>(&amp;self, B: B);
}</code>

View file

@ -0,0 +1,2 @@
<code>pub fn charlie&lt;C&gt;()<span class="where fmt-newline">where
C: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></code>

View file

@ -0,0 +1,2 @@
<code>pub type Golf&lt;T&gt;<span class="where fmt-newline">where
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>

View file

@ -5,16 +5,20 @@
pub trait MyTrait { fn dummy(&self) { } }
// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
// @snapshot alpha_trait_decl - '//*[@class="rust item-decl"]/code'
pub struct Alpha<A>(A) where A: MyTrait;
// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait"
// @snapshot bravo_trait_decl - '//*[@class="rust item-decl"]/code'
pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait"
// @snapshot charlie_fn_decl - '//*[@class="rust item-decl"]/code'
pub fn charlie<C>() where C: MyTrait {}
pub struct Delta<D>(D);
// @has foo/struct.Delta.html '//*[@class="impl"]//h3[@class="code-header"]' \
// "impl<D> Delta<D>where D: MyTrait"
// @snapshot SWhere_Echo_impl - '//*[@id="impl-Delta%3CD%3E"]/h3[@class="code-header"]'
impl<D> Delta<D> where D: MyTrait {
pub fn delta() {}
}
@ -65,4 +69,5 @@ impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}
// @has foo/type.Golf.html '//pre[@class="rust item-decl"]' \
// "type Golf<T>where T: Clone, = (T, T)"
// @snapshot golf_type_alias_decl - '//*[@class="rust item-decl"]/code'
pub type Golf<T> where T: Clone = (T, T);