]>
Commit | Line | Data |
---|---|---|
cdc7bbd5 | 1 | #![feature(doc_notable_trait)] |
3dfed10e XL |
2 | |
3 | pub struct Wrapper<T> { | |
4 | inner: T, | |
5 | } | |
6 | ||
7 | impl<T: SomeTrait> SomeTrait for Wrapper<T> {} | |
8 | ||
cdc7bbd5 | 9 | #[doc(notable_trait)] |
3dfed10e | 10 | pub trait SomeTrait { |
cdc7bbd5 | 11 | // @has doc_notable_trait/trait.SomeTrait.html |
9ffffee4 | 12 | // @has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper<Self>' |
487cf647 | 13 | // @snapshot wrap-me - '//script[@id="notable-traits-data"]' |
3dfed10e XL |
14 | fn wrap_me(self) -> Wrapper<Self> where Self: Sized { |
15 | Wrapper { | |
16 | inner: self, | |
17 | } | |
18 | } | |
19 | } | |
20 | ||
21 | pub struct SomeStruct; | |
22 | impl SomeTrait for SomeStruct {} | |
23 | ||
24 | impl SomeStruct { | |
cdc7bbd5 | 25 | // @has doc_notable_trait/struct.SomeStruct.html |
9ffffee4 | 26 | // @has - '//a[@class="tooltip"]/@data-notable-ty' 'SomeStruct' |
487cf647 | 27 | // @snapshot some-struct-new - '//script[@id="notable-traits-data"]' |
3dfed10e XL |
28 | pub fn new() -> SomeStruct { |
29 | SomeStruct | |
30 | } | |
31 | } | |
32 | ||
cdc7bbd5 | 33 | // @has doc_notable_trait/fn.bare_fn.html |
9ffffee4 | 34 | // @has - '//a[@class="tooltip"]/@data-notable-ty' 'SomeStruct' |
487cf647 | 35 | // @snapshot bare-fn - '//script[@id="notable-traits-data"]' |
3dfed10e XL |
36 | pub fn bare_fn() -> SomeStruct { |
37 | SomeStruct | |
38 | } |