2022-08-30 18:51:58 +00:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2023-03-21 15:44:06 +00:00
|
|
|
#![feature(rustc_attrs)]
|
2022-08-30 18:51:58 +00:00
|
|
|
|
|
|
|
// @has foo/index.html
|
|
|
|
// @has - '//h2[@id="primitives"]' 'Primitive Types'
|
|
|
|
// @has - '//a[@href="primitive.reference.html"]' 'reference'
|
|
|
|
// @has - '//div[@class="sidebar-elems"]//li/a' 'Primitive Types'
|
|
|
|
// @has - '//div[@class="sidebar-elems"]//li/a/@href' '#primitives'
|
|
|
|
// @has foo/primitive.reference.html
|
|
|
|
// @has - '//a[@class="primitive"]' 'reference'
|
2023-01-13 17:09:25 +00:00
|
|
|
// @has - '//h1' 'Primitive Type reference'
|
2022-08-30 18:51:58 +00:00
|
|
|
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
|
|
|
|
|
|
|
|
// There should be only one implementation listed.
|
2023-01-28 23:35:02 +00:00
|
|
|
// @count - '//*[@class="impl"]' 1
|
2022-09-25 20:52:26 +00:00
|
|
|
// @has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header"]' \
|
2022-08-30 18:51:58 +00:00
|
|
|
// 'impl<A, B> Foo<&A> for &B'
|
2023-03-21 15:44:06 +00:00
|
|
|
#[rustc_doc_primitive = "reference"]
|
2022-08-30 18:51:58 +00:00
|
|
|
/// this is a test!
|
|
|
|
mod reference {}
|
|
|
|
|
|
|
|
pub struct Bar;
|
|
|
|
|
|
|
|
// This implementation should **not** show up.
|
|
|
|
impl<T> From<&T> for Bar {
|
|
|
|
fn from(s: &T) -> Self {
|
|
|
|
Bar
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Foo<T> {
|
|
|
|
fn stuff(&self, other: &T) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
// This implementation should show up.
|
|
|
|
impl<A, B> Foo<&A> for &B {}
|