]>
Commit | Line | Data |
---|---|---|
f9f354fc XL |
1 | #![crate_name = "foo"] |
2 | ||
f9f354fc XL |
3 | |
4 | pub struct MyStruct; | |
5 | ||
6 | impl MyTrait for MyStruct { | |
7 | ||
cdc7bbd5 | 8 | // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedtype.AssoType' |
f9f354fc XL |
9 | |
10 | /// [`AssoType`] | |
11 | /// | |
12 | /// [`AssoType`]: MyStruct::AssoType | |
13 | type AssoType = u32; | |
14 | ||
cdc7bbd5 | 15 | // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedconstant.ASSO_CONST' |
f9f354fc XL |
16 | |
17 | /// [`ASSO_CONST`] | |
18 | /// | |
19 | /// [`ASSO_CONST`]: MyStruct::ASSO_CONST | |
20 | const ASSO_CONST: i32 = 10; | |
21 | ||
cdc7bbd5 | 22 | // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.trait_fn' |
f9f354fc XL |
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 | } |