2021-03-08 21:35:53 -06:00
|
|
|
#![feature(doc_notable_trait)]
|
2020-07-06 14:53:44 -05:00
|
|
|
|
|
|
|
pub struct Wrapper<T> {
|
|
|
|
inner: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: SomeTrait> SomeTrait for Wrapper<T> {}
|
|
|
|
|
2021-03-08 21:35:53 -06:00
|
|
|
#[doc(notable_trait)]
|
2020-07-06 14:53:44 -05:00
|
|
|
pub trait SomeTrait {
|
2021-03-08 21:35:53 -06:00
|
|
|
// @has doc_notable_trait/trait.SomeTrait.html
|
2022-11-08 18:49:29 -06:00
|
|
|
// @has - '//a[@class="notable-traits"]/@data-ty' 'Wrapper<Self>'
|
2022-11-07 16:53:30 -06:00
|
|
|
// @snapshot wrap-me - '//script[@id="notable-traits-data"]'
|
2020-07-06 14:53:44 -05:00
|
|
|
fn wrap_me(self) -> Wrapper<Self> where Self: Sized {
|
|
|
|
Wrapper {
|
|
|
|
inner: self,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SomeStruct;
|
|
|
|
impl SomeTrait for SomeStruct {}
|
|
|
|
|
|
|
|
impl SomeStruct {
|
2021-03-08 21:35:53 -06:00
|
|
|
// @has doc_notable_trait/struct.SomeStruct.html
|
2022-11-08 18:49:29 -06:00
|
|
|
// @has - '//a[@class="notable-traits"]/@data-ty' 'SomeStruct'
|
2022-11-07 16:53:30 -06:00
|
|
|
// @snapshot some-struct-new - '//script[@id="notable-traits-data"]'
|
2020-07-06 14:53:44 -05:00
|
|
|
pub fn new() -> SomeStruct {
|
|
|
|
SomeStruct
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-08 21:35:53 -06:00
|
|
|
// @has doc_notable_trait/fn.bare_fn.html
|
2022-11-08 18:49:29 -06:00
|
|
|
// @has - '//a[@class="notable-traits"]/@data-ty' 'SomeStruct'
|
2022-11-07 16:53:30 -06:00
|
|
|
// @snapshot bare-fn - '//script[@id="notable-traits-data"]'
|
2020-07-06 14:53:44 -05:00
|
|
|
pub fn bare_fn() -> SomeStruct {
|
|
|
|
SomeStruct
|
|
|
|
}
|