Closed
Description
It would be nice to be able to specify multiple aliases in one #[doc(alias)]
attribute (as an array). This would be particularily useful for crates that export multiple derive macros with different sets of attributes. With #[doc(alias)]
, these can make the derive macro findable by any of its attributes names, e.g. serde could do sth. like
#[doc(alias = "default")]
#[doc(alias = "deny_unknown_fields")]
#[doc(alias = "untagged")]
#[doc(alias = "...")]
pub trait Deserialize<'de>: Sized { /* ... */ }
#[doc(alias = "into")]
#[doc(alias = "getter")]
#[doc(alias = "untagged")]
#[doc(alias = "...")]
pub trait Serialize { /* ... */ }
but needing one attribute / line for every attribute gets a bit unwieldy. This would be better:
#[doc(alias = ["default", "deny_unknown_fields", "untagged", "...")]
pub trait Deserialize<'de>: Sized { /* ... */ }
#[doc(alias = ["into", "getter", "untagged", "..."])]
pub trait Serialize { /* ... */ }