]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/intra-links.rs
Auto merge of #56534 - xfix:copied, r=@SimonSapin
[rust.git] / src / test / rustdoc / intra-links.rs
1 // @has intra_links/index.html
2 // @has - '//a/@href' '../intra_links/struct.ThisType.html'
3 // @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method'
4 // @has - '//a/@href' '../intra_links/enum.ThisEnum.html'
5 // @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v'
6 // @has - '//a/@href' '../intra_links/trait.ThisTrait.html'
7 // @has - '//a/@href' '../intra_links/trait.ThisTrait.html#tymethod.this_associated_method'
8 // @has - '//a/@href' '../intra_links/trait.ThisTrait.html#associatedtype.ThisAssociatedType'
9 // @has - '//a/@href' '../intra_links/trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST'
10 // @has - '//a/@href' '../intra_links/trait.ThisTrait.html'
11 // @has - '//a/@href' '../intra_links/type.ThisAlias.html'
12 // @has - '//a/@href' '../intra_links/union.ThisUnion.html'
13 // @has - '//a/@href' '../intra_links/fn.this_function.html'
14 // @has - '//a/@href' '../intra_links/constant.THIS_CONST.html'
15 // @has - '//a/@href' '../intra_links/static.THIS_STATIC.html'
16 // @has - '//a/@href' '../intra_links/macro.this_macro.html'
17 // @has - '//a/@href' '../intra_links/trait.SoAmbiguous.html'
18 // @has - '//a/@href' '../intra_links/fn.SoAmbiguous.html'
19 //! In this crate we would like to link to:
20 //!
21 //! * [`ThisType`](ThisType)
22 //! * [`ThisType::this_method`](ThisType::this_method)
23 //! * [`ThisEnum`](ThisEnum)
24 //! * [`ThisEnum::ThisVariant`](ThisEnum::ThisVariant)
25 //! * [`ThisTrait`](ThisTrait)
26 //! * [`ThisTrait::this_associated_method`](ThisTrait::this_associated_method)
27 //! * [`ThisTrait::ThisAssociatedType`](ThisTrait::ThisAssociatedType)
28 //! * [`ThisTrait::THIS_ASSOCIATED_CONST`](ThisTrait::THIS_ASSOCIATED_CONST)
29 //! * [`ThisAlias`](ThisAlias)
30 //! * [`ThisUnion`](ThisUnion)
31 //! * [`this_function`](this_function())
32 //! * [`THIS_CONST`](const@THIS_CONST)
33 //! * [`THIS_STATIC`](static@THIS_STATIC)
34 //! * [`this_macro`](this_macro!)
35 //!
36 //! In addition, there's some specifics we want to look at. There's [a trait called
37 //! SoAmbiguous][ambig-trait], but there's also [a function called SoAmbiguous][ambig-fn] too!
38 //! Whatever shall we do?
39 //!
40 //! [ambig-trait]: trait@SoAmbiguous
41 //! [ambig-fn]: SoAmbiguous()
42
43 #[macro_export]
44 macro_rules! this_macro {
45     () => {};
46 }
47
48 pub struct ThisType;
49
50 impl ThisType {
51     pub fn this_method() {}
52 }
53 pub enum ThisEnum { ThisVariant, }
54 pub trait ThisTrait {
55     type ThisAssociatedType;
56     const THIS_ASSOCIATED_CONST: u8;
57     fn this_associated_method();
58 }
59 pub type ThisAlias = Result<(), ()>;
60 pub union ThisUnion { this_field: usize, }
61
62 pub fn this_function() {}
63 pub const THIS_CONST: usize = 5usize;
64 pub static THIS_STATIC: usize = 5usize;
65
66 pub trait SoAmbiguous {}
67
68 #[allow(nonstandard_style)]
69 pub fn SoAmbiguous() {}
70
71
72 // @has - '//a/@href' '../intra_links/struct.ThisType.html'
73 // @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method'
74 // @has - '//a/@href' '../intra_links/enum.ThisEnum.html'
75 // @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v'
76 /// Shortcut links for:
77 /// * [`ThisType`]
78 /// * [`ThisType::this_method`]
79 /// * [ThisEnum]
80 /// * [ThisEnum::ThisVariant]
81 pub struct SomeOtherType;