You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
309
307
310
308
r[attributes.diagnostics.deprecated.syntax]
311
309
The `deprecated` attribute has several forms:
312
310
313
311
-`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.
316
313
-[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.
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
+
330
320
<!-- NOTE: It is only rejected for trait impl items
331
321
(AnnotationKind::Prohibited). In all other locations, it is silently ignored.
0 commit comments