summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-js/doc-alias.rs
blob: 750b7b757bc3551de39017bf7aa5ab1fad57979b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#[doc(alias = "StructItem")]
pub struct Struct {
    #[doc(alias = "StructFieldItem")]
    pub field: u32,
}

impl Struct {
    #[doc(alias = "StructImplConstItem")]
    pub const ImplConstItem: i32 = 0;
    #[doc(alias = "StructMethodItem")]
    pub fn method(&self) {}
}

impl Trait for Struct {
    type Target = u32;
    const AssociatedConst: i32 = 12;

    #[doc(alias = "ImplTraitFunction")]
    fn function() -> Self::Target { 0 }
}

#[doc(alias = "EnumItem")]
pub enum Enum {
    #[doc(alias = "VariantItem")]
    Variant,
}

impl Enum {
    #[doc(alias = "EnumMethodItem")]
    pub fn method(&self) {}
}

#[doc(alias = "TypedefItem")]
pub type Typedef = i32;

#[doc(alias = "TraitItem")]
pub trait Trait {
    #[doc(alias = "TraitTypeItem")]
    type Target;
    #[doc(alias = "AssociatedConstItem")]
    const AssociatedConst: i32;

    #[doc(alias = "TraitFunctionItem")]
    fn function() -> Self::Target;
}

#[doc(alias = "FunctionItem")]
pub fn function() {}

#[doc(alias = "ModuleItem")]
pub mod Module {}

#[doc(alias = "ConstItem")]
pub const Const: u32 = 0;

#[doc(alias = "StaticItem")]
pub static Static: u32 = 0;

#[doc(alias = "UnionItem")]
pub union Union {
    #[doc(alias = "UnionFieldItem")]
    pub union_item: u32,
    pub y: f32,
}

impl Union {
    #[doc(alias = "UnionMethodItem")]
    pub fn method(&self) {}
}

#[doc(alias = "MacroItem")]
#[macro_export]
macro_rules! Macro {
    () => {}
}