]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/intra-doc/trait-impl.rs
Rollup merge of #93755 - ChayimFriedman2:allow-comparing-vecs-with-different-allocato...
[rust.git] / src / test / rustdoc / intra-doc / trait-impl.rs
1 #![crate_name = "foo"]
2
3
4 pub struct MyStruct;
5
6 impl MyTrait for MyStruct {
7
8 // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedtype.AssoType'
9
10     /// [`AssoType`]
11     ///
12     /// [`AssoType`]: MyStruct::AssoType
13     type AssoType = u32;
14
15 // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedconstant.ASSO_CONST'
16
17     /// [`ASSO_CONST`]
18     ///
19     /// [`ASSO_CONST`]: MyStruct::ASSO_CONST
20     const ASSO_CONST: i32 = 10;
21
22 // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.trait_fn'
23
24     /// [`trait_fn`]
25     ///
26     /// [`trait_fn`]: MyStruct::trait_fn
27     fn trait_fn() { }
28 }
29
30 pub trait MyTrait {
31     type AssoType;
32     const ASSO_CONST: i32 = 1;
33     fn trait_fn();
34 }