]> git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/doc-notable_trait.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / rustdoc / doc-notable_trait.rs
1 #![feature(doc_notable_trait)]
2
3 pub struct Wrapper<T> {
4 inner: T,
5 }
6
7 impl<T: SomeTrait> SomeTrait for Wrapper<T> {}
8
9 #[doc(notable_trait)]
10 pub trait SomeTrait {
11 // @has doc_notable_trait/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_notable_trait/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_notable_trait/fn.bare_fn.html
33 // @has - '//code[@class="content"]' 'impl SomeTrait for SomeStruct'
34 pub fn bare_fn() -> SomeStruct {
35 SomeStruct
36 }