rust/tests/rustdoc-js/doc-alias.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.0 KiB
Rust
Raw Normal View History

2024-06-06 21:49:46 +00:00
/// Doc for `Struct`
2020-04-30 22:27:24 +00:00
#[doc(alias = "StructItem")]
pub struct Struct {
2024-06-06 21:49:46 +00:00
/// Doc for `Struct`'s `field`
2020-04-30 22:27:24 +00:00
#[doc(alias = "StructFieldItem")]
pub field: u32,
}
impl Struct {
2024-06-06 21:49:46 +00:00
/// Doc for `Struct::ImplConstItem`
#[doc(alias = "StructImplConstItem")]
pub const ImplConstItem: i32 = 0;
2024-06-06 21:49:46 +00:00
/// Doc for `Struct::method`
2020-04-30 22:27:24 +00:00
#[doc(alias = "StructMethodItem")]
pub fn method(&self) {}
}
impl Trait for Struct {
type Target = u32;
const AssociatedConst: i32 = 12;
2024-06-06 21:49:46 +00:00
/// Doc for `Trait::function` implemented for Struct
2020-04-30 22:27:24 +00:00
#[doc(alias = "ImplTraitFunction")]
2024-06-03 07:35:56 +00:00
fn function() -> Self::Target {
0
}
2020-04-30 22:27:24 +00:00
}
2024-06-06 21:49:46 +00:00
/// Doc for `Enum`
2020-04-30 22:27:24 +00:00
#[doc(alias = "EnumItem")]
pub enum Enum {
2024-06-06 21:49:46 +00:00
/// Doc for `Enum::Variant`
2020-04-30 22:27:24 +00:00
#[doc(alias = "VariantItem")]
Variant,
}
impl Enum {
2024-06-06 21:49:46 +00:00
/// Doc for `Enum::method`
2020-04-30 22:27:24 +00:00
#[doc(alias = "EnumMethodItem")]
pub fn method(&self) {}
}
2024-06-06 21:49:46 +00:00
/// Doc for type alias `Typedef`
2020-04-30 22:27:24 +00:00
#[doc(alias = "TypedefItem")]
pub type Typedef = i32;
2024-06-06 21:49:46 +00:00
/// Doc for `Trait`
2020-04-30 22:27:24 +00:00
#[doc(alias = "TraitItem")]
pub trait Trait {
2024-06-06 21:49:46 +00:00
/// Doc for `Trait::Target`
2020-04-30 22:27:24 +00:00
#[doc(alias = "TraitTypeItem")]
type Target;
2024-06-06 21:49:46 +00:00
/// Doc for `Trait::AssociatedConst`
2020-04-30 22:27:24 +00:00
#[doc(alias = "AssociatedConstItem")]
const AssociatedConst: i32;
2024-06-06 21:49:46 +00:00
/// Doc for `Trait::function`
2020-04-30 22:27:24 +00:00
#[doc(alias = "TraitFunctionItem")]
fn function() -> Self::Target;
}
2024-06-06 21:49:46 +00:00
/// Doc for `function`
2020-04-30 22:27:24 +00:00
#[doc(alias = "FunctionItem")]
pub fn function() {}
2024-06-06 21:49:46 +00:00
/// Doc for `Module`
2020-04-30 22:27:24 +00:00
#[doc(alias = "ModuleItem")]
pub mod Module {}
2024-06-06 21:49:46 +00:00
/// Doc for `Const`
2020-04-30 22:27:24 +00:00
#[doc(alias = "ConstItem")]
pub const Const: u32 = 0;
2024-06-06 21:49:46 +00:00
/// Doc for `Static`
2020-04-30 22:27:24 +00:00
#[doc(alias = "StaticItem")]
pub static Static: u32 = 0;
2024-06-06 21:49:46 +00:00
/// Doc for `Union`
2020-04-30 22:27:24 +00:00
#[doc(alias = "UnionItem")]
pub union Union {
2024-06-06 21:49:46 +00:00
/// Doc for `Union::union_item`
2020-04-30 22:27:24 +00:00
#[doc(alias = "UnionFieldItem")]
pub union_item: u32,
pub y: f32,
}
impl Union {
2024-06-06 21:49:46 +00:00
/// Doc for `Union::method`
2020-04-30 22:27:24 +00:00
#[doc(alias = "UnionMethodItem")]
pub fn method(&self) {}
}
2024-06-06 21:49:46 +00:00
/// Doc for `Macro`
2020-04-30 22:27:24 +00:00
#[doc(alias = "MacroItem")]
#[macro_export]
macro_rules! Macro {
2024-06-03 07:35:56 +00:00
() => {};
2020-04-30 22:27:24 +00:00
}