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
A few updates for the docs here:
- Fix mistake using wrong attribute name
- Add annotations
- Try to clarify what kind of behavior the attribute has
- Separate allowed-positions, and syntax as separate concerns.
The `deprecated` attribute may be applied to any [item], [trait item], [enum
331
331
variant], [struct field], [external block item], or [macro definition]. It
332
-
cannot be applied to [trait implementation items]. When applied to an item
332
+
cannot be applied to [trait implementation items][trait-impl]. When applied to an item
333
333
containing other items, such as a [module] or [implementation], all child
334
334
items inherit the deprecation attribute.
335
335
<!-- NOTE: It is only rejected for trait impl items
@@ -561,8 +561,16 @@ error[E0277]: My Message for `ImportantTrait<i32>` implemented for `String`
561
561
562
562
### The `diagnostic::do_not_recommend` attribute
563
563
564
-
The `#[diagnostic::on_unimplemented]` attribute is a hint to the compiler to not show a certain trait implementation as part of the error message.
565
-
The attribute should be placed on a [trait implementation items]. It does not accept any arguments. If the attribute is placed in a wrong location or contains an unexpected argument the compiler might emit a warning and otherwise ignore the malformed part.
564
+
r[attributes.diagnostic.do_not_recommend]
565
+
566
+
r[attributes.diagnostic.do_not_recommend.intro]
567
+
The `#[diagnostic::do_not_recommend]` attribute is a hint to the compiler to not show the annotated trait implementation as part of a diagnostic message. For example, in an error message about a type not implementing a required trait, the compiler may indicate that an unsatisfied trait bound is a result of the given trait implementation. The `#[diagnostic::do_not_recommend]` attribute can be used to prevent those annotations about the trait implementation from being included in the diagnostic when they are unlikely to be useful.
0 commit comments