]> git.proxmox.com Git - rustc.git/blame - tests/rustdoc/notable-trait/doc-notable_trait.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / rustdoc / notable-trait / doc-notable_trait.rs
CommitLineData
cdc7bbd5 1#![feature(doc_notable_trait)]
3dfed10e
XL
2
3pub struct Wrapper<T> {
4 inner: T,
5}
6
7impl<T: SomeTrait> SomeTrait for Wrapper<T> {}
8
cdc7bbd5 9#[doc(notable_trait)]
3dfed10e 10pub 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
21pub struct SomeStruct;
22impl SomeTrait for SomeStruct {}
23
24impl 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
36pub fn bare_fn() -> SomeStruct {
37 SomeStruct
38}