Skip to content

Commit 3f4ddcf

Browse files
committed
Unwrap deprecated
1 parent d4c66b3 commit 3f4ddcf

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

src/attributes/diagnostics.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -303,30 +303,20 @@ r[attributes.diagnostics.deprecated]
303303
## The `deprecated` attribute
304304

305305
r[attributes.diagnostics.deprecated.intro]
306-
The *`deprecated` attribute* marks an item as deprecated. `rustc` will issue
307-
warnings on usage of `#[deprecated]` items. `rustdoc` will show item
308-
deprecation, including the `since` version and `note`, if available.
306+
The *`deprecated` attribute* marks an item as deprecated. `rustc` will issue warnings on usage of `#[deprecated]` items. `rustdoc` will show item deprecation, including the `since` version and `note`, if available.
309307

310308
r[attributes.diagnostics.deprecated.syntax]
311309
The `deprecated` attribute has several forms:
312310

313311
- `deprecated` --- Issues a generic message.
314-
- `deprecated = "message"` --- Includes the given string in the deprecation
315-
message.
312+
- `deprecated = "message"` --- Includes the given string in the deprecation message.
316313
- [MetaListNameValueStr] syntax with two optional fields:
317-
- `since` --- Specifies a version number when the item was deprecated. `rustc`
318-
does not currently interpret the string, but external tools like [Clippy]
319-
may check the validity of the value.
320-
- `note` --- Specifies a string that should be included in the deprecation
321-
message. This is typically used to provide an explanation about the
322-
deprecation and preferred alternatives.
314+
- `since` --- Specifies a version number when the item was deprecated. `rustc` does not currently interpret the string, but external tools like [Clippy] may check the validity of the value.
315+
- `note` --- Specifies a string that should be included in the deprecation message. This is typically used to provide an explanation about the deprecation and preferred alternatives.
323316

324317
r[attributes.diagnostic.deprecated.allowed-positions]
325-
The `deprecated` attribute may be applied to any [item], [trait item], [enum
326-
variant], [struct field], [external block item], or [macro definition]. It
327-
cannot be applied to [trait implementation items][trait-impl]. When applied to an item
328-
containing other items, such as a [module] or [implementation], all child
329-
items inherit the deprecation attribute.
318+
The `deprecated` attribute may be applied to any [item], [trait item], [enum variant], [struct field], [external block item], or [macro definition]. It cannot be applied to [trait implementation items][trait-impl]. When applied to an item containing other items, such as a [module] or [implementation], all child items inherit the deprecation attribute.
319+
330320
<!-- NOTE: It is only rejected for trait impl items
331321
(AnnotationKind::Prohibited). In all other locations, it is silently ignored.
332322
Tuple struct fields are ignored.

0 commit comments

Comments
 (0)