Skip to content

Commit 35b3577

Browse files
committed
Add test for rust-lang#112901
It's a lot of snapshots, but it's quite hard to test this sort of formatting with other ways.
1 parent 89c0e58 commit 35b3577

7 files changed

+56
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<section id="associatedtype.F" class="associatedtype trait-impl"><a href="#associatedtype.F" class="anchor">&#167;</a><h4 class="code-header">type <a href="trait.Tr.html#associatedtype.F" class="associatedtype">F</a>&lt;T&gt; = T
2+
<span class="where">where
3+
T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span></h4></section>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<section id="associatedtype.F" class="method"><a class="srclink rightside" href="../../src/foo/issue-112901-where-clause.rs.html#28-30">source</a><h4 class="code-header">type <a href="#associatedtype.F" class="associatedtype">F</a>&lt;T&gt;
2+
<span class="where">where
3+
T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span></h4></section>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<pre class="rust item-decl"><code>pub trait Tr {
2+
type <a href="#associatedtype.F" class="associatedtype">F</a>&lt;T&gt;
3+
<span class="where">where
4+
T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span>;
5+
}</code></pre>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<section id="associatedtype.F-1" class="associatedtype trait-impl"><a href="#associatedtype.F-1" class="anchor">&#167;</a><h4 class="code-header">type <a href="#associatedtype.F" class="associatedtype">F</a>&lt;T&gt; = T
2+
<span class="where">where
3+
T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span></h4></section>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#![crate_name = "foo"]
2+
#![feature(trivial_bounds)]
3+
4+
pub mod structs {
5+
// @has foo/structs/struct.A.html
6+
// @snapshot structs-A - '//pre[@class="rust item-decl"]'
7+
pub struct A<T>(T)
8+
where
9+
T: Copy;
10+
11+
// @has foo/structs/struct.S.html
12+
// @snapshot structs-S - '//pre[@class="rust item-decl"]'
13+
pub struct S
14+
where
15+
String: Clone;
16+
}
17+
18+
pub mod assoc {
19+
// @has foo/assoc/struct.S.html
20+
// @snapshot assoc-S-impl-F - '//section[@id="associatedtype.F"]'
21+
pub struct S;
22+
23+
// @has foo/assoc/trait.Tr.html
24+
// @snapshot assoc-Tr-decl - '//pre[@class="rust item-decl"]'
25+
// @snapshot assoc-Tr-F - '//section[@id="associatedtype.F"]'
26+
// @snapshot assoc-Tr-impl-F - '//section[@id="associatedtype.F-1"]'
27+
pub trait Tr {
28+
type F<T>
29+
where
30+
T: Clone;
31+
}
32+
33+
impl Tr for S {
34+
type F<T> = T where T: Clone;
35+
}
36+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<pre class="rust item-decl"><code>pub struct A&lt;T&gt;(_)
2+
<span class="where">where
3+
T: <a class="trait" href="{{channel}}/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a></span>;</code></pre>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<pre class="rust item-decl"><code>pub struct S
2+
<span class="where">where
3+
<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span>;</code></pre>

0 commit comments

Comments
 (0)