Skip to content

Update that macros can be deprecated. #813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/attributes/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ The `deprecated` attribute has several forms:
deprecation and preferred alternatives.

The `deprecated` attribute may be applied to any [item], [trait item], [enum
variant], [struct field], or [external block item]. It cannot be applied to [trait
implementation items]. When applied to an item containing other items, such as
a [module] or [implementation], all child items inherit the deprecation attribute.
<!-- NOTE: Currently broken for macros, see https://github.com/rust-lang/rust/issues/49912
Also, it is only rejected for trait impl items (AnnotationKind::Prohibited). In all
other locations, it is silently ignored. Tuple struct fields are ignored.
variant], [struct field], [external block item], or [macro definition]. It
cannot be applied to [trait implementation items]. When applied to an item
containing other items, such as a [module] or [implementation], all child
items inherit the deprecation attribute.
<!-- NOTE: It is only rejected for trait impl items
(AnnotationKind::Prohibited). In all other locations, it is silently ignored.
Tuple struct fields are ignored.
-->

Here is an example:
Expand Down Expand Up @@ -270,6 +271,7 @@ When used on a function in a trait implementation, the attribute does nothing.
[implementation]: ../items/implementations.md
[item]: ../items.md
[let statement]: ../statements.md#let-statements
[macro definition]: ../macros-by-example.md
[module]: ../items/modules.md
[rustc book]: ../../rustc/lints/index.html
[struct field]: ../items/structs.md
Expand Down