1 // This test ensures there is no whitespace before the first brace of
2 // trait, enum, struct and union items when they have a where clause.
6 // @has 'foo/trait.ToOwned.html'
7 // @snapshot trait - '//*[@class="docblock item-decl"]'
12 fn to_owned(&self) -> Self::Owned;
13 fn whatever(&self) -> T;
16 // @has 'foo/trait.ToOwned2.html'
17 // @snapshot trait2 - '//*[@class="docblock item-decl"]'
18 // There should be a whitespace before `{` in this case!
19 pub trait ToOwned2<T: Clone> {
21 fn to_owned(&self) -> Self::Owned;
22 fn whatever(&self) -> T;
25 // @has 'foo/enum.Cow.html'
26 // @snapshot enum - '//*[@class="docblock item-decl"]'
27 pub enum Cow<'a, B: ?Sized + 'a>
35 // @has 'foo/enum.Cow2.html'
36 // @snapshot enum2 - '//*[@class="docblock item-decl"]'
37 // There should be a whitespace before `{` in this case!
38 pub enum Cow2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
43 // @has 'foo/struct.Struct.html'
44 // @snapshot struct - '//*[@class="docblock item-decl"]'
45 pub struct Struct<'a, B: ?Sized + 'a>
53 // @has 'foo/struct.Struct2.html'
54 // @snapshot struct2 - '//*[@class="docblock item-decl"]'
55 // There should be a whitespace before `{` in this case!
56 pub struct Struct2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
61 // @has 'foo/union.Union.html'
62 // @snapshot union - '//*[@class="docblock item-decl"]'
63 pub union Union<'a, B: ?Sized + 'a>
71 // @has 'foo/union.Union2.html'
72 // @snapshot union2 - '//*[@class="docblock item-decl"]'
73 // There should be a whitespace before `{` in this case!
74 pub union Union2<'a, B: ?Sized + ToOwned<Clone> + 'a> {