-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-doc-aliasArea: `#[doc(alias)]`Area: `#[doc(alias)]`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language teamT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
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 { /* ... */ }
slerpyyy and PatchMixolydic
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-doc-aliasArea: `#[doc(alias)]`Area: `#[doc(alias)]`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language teamT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.