]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/doc-spotlight.rs
Auto merge of #57035 - Zoxc:query-pref9, r=michaelwoerister
[rust.git] / src / test / rustdoc / doc-spotlight.rs
1 #![feature(doc_spotlight)]
2
3 pub struct Wrapper<T> {
4     inner: T,
5 }
6
7 impl<T: SomeTrait> SomeTrait for Wrapper<T> {}
8
9 #[doc(spotlight)]
10 pub trait SomeTrait {
11     // @has doc_spotlight/trait.SomeTrait.html
12     // @has - '//code[@class="content"]' 'impl<T: SomeTrait> SomeTrait for Wrapper<T>'
13     fn wrap_me(self) -> Wrapper<Self> where Self: Sized {
14         Wrapper {
15             inner: self,
16         }
17     }
18 }
19
20 pub struct SomeStruct;
21 impl SomeTrait for SomeStruct {}
22
23 impl SomeStruct {
24     // @has doc_spotlight/struct.SomeStruct.html
25     // @has - '//code[@class="content"]' 'impl SomeTrait for SomeStruct'
26     // @has - '//code[@class="content"]' 'impl<T: SomeTrait> SomeTrait for Wrapper<T>'
27     pub fn new() -> SomeStruct {
28         SomeStruct
29     }
30 }
31
32 // @has doc_spotlight/fn.bare_fn.html
33 // @has - '//code[@class="content"]' 'impl SomeTrait for SomeStruct'
34 pub fn bare_fn() -> SomeStruct {
35     SomeStruct
36 }