]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/intra-doc/generic-trait-impl.rs
Rollup merge of #106618 - jmillikin:os-net-rustdoc-wasm32, r=JohnTitor
[rust.git] / tests / rustdoc / intra-doc / generic-trait-impl.rs
1 #![deny(rustdoc::broken_intra_doc_links)]
2
3 // Test intra-doc links on trait implementations with generics
4 // regression test for issue #92662
5
6 use std::marker::PhantomData;
7
8 pub trait Bar<T> {
9     fn bar(&self);
10 }
11
12 pub struct Foo<U>(PhantomData<U>);
13
14 impl<T, U> Bar<T> for Foo<U> {
15     fn bar(&self) {}
16 }
17
18 // @has generic_trait_impl/fn.main.html '//a[@href="struct.Foo.html#method.bar"]' 'Foo::bar'
19 /// link to [`Foo::bar`]
20 pub fn main() {}