]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/intra-links.rs
Rollup merge of #68378 - billyrieger:btreemap-remove-entry, r=KodrAus
[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 //! * [`ThisEnum::ThisVariantCtor`](ThisEnum::ThisVariantCtor)
26 //! * [`ThisTrait`](ThisTrait)
27 //! * [`ThisTrait::this_associated_method`](ThisTrait::this_associated_method)
28 //! * [`ThisTrait::ThisAssociatedType`](ThisTrait::ThisAssociatedType)
29 //! * [`ThisTrait::THIS_ASSOCIATED_CONST`](ThisTrait::THIS_ASSOCIATED_CONST)
30 //! * [`ThisAlias`](ThisAlias)
31 //! * [`ThisUnion`](ThisUnion)
32 //! * [`this_function`](this_function())
33 //! * [`THIS_CONST`](const@THIS_CONST)
34 //! * [`THIS_STATIC`](static@THIS_STATIC)
35 //! * [`this_macro`](this_macro!)
36 //!
37 //! In addition, there's some specifics we want to look at. There's [a trait called
38 //! SoAmbiguous][ambig-trait], but there's also [a function called SoAmbiguous][ambig-fn] too!
39 //! Whatever shall we do?
40 //!
41 //! [ambig-trait]: trait@SoAmbiguous
42 //! [ambig-fn]: SoAmbiguous()
43
44 #[macro_export]
45 macro_rules! this_macro {
46     () => {};
47 }
48
49 pub struct ThisType;
50
51 impl ThisType {
52     pub fn this_method() {}
53 }
54 pub enum ThisEnum { ThisVariant, ThisVariantCtor(u32), }
55 pub trait ThisTrait {
56     type ThisAssociatedType;
57     const THIS_ASSOCIATED_CONST: u8;
58     fn this_associated_method();
59 }
60 pub type ThisAlias = Result<(), ()>;
61 pub union ThisUnion { this_field: usize, }
62
63 pub fn this_function() {}
64 pub const THIS_CONST: usize = 5usize;
65 pub static THIS_STATIC: usize = 5usize;
66
67 pub trait SoAmbiguous {}
68
69 #[allow(nonstandard_style)]
70 pub fn SoAmbiguous() {}
71
72
73 // @has - '//a/@href' '../intra_links/struct.ThisType.html'
74 // @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method'
75 // @has - '//a/@href' '../intra_links/enum.ThisEnum.html'
76 // @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v'
77 /// Shortcut links for:
78 /// * [`ThisType`]
79 /// * [`ThisType::this_method`]
80 /// * [ThisEnum]
81 /// * [ThisEnum::ThisVariant]
82 pub struct SomeOtherType;