Skip to content

Commit 341cc83

Browse files
committed
Soften the language to say "usually"
There may be times when the recommendation is useful, but the intent is to use the attribute when it usually is not.
1 parent 6fc4148 commit 341cc83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/attributes/diagnostics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ r[attributes.diagnostic.do_not_recommend]
566566
r[attributes.diagnostic.do_not_recommend.intro]
567567
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.
568568

569-
> **Note**: Suppressing the recommendation can be useful if you know that the recommendation would not be useful to the programmer. This often occurs with broad, blanket impls. The recommendation may send the programmer down the wrong path, or the trait implementation may be an internal detail that you don't want to expose, or the bounds may not be able to be satisfied by the programmer.
569+
> **Note**: Suppressing the recommendation can be useful if you know that the recommendation would usually not be useful to the programmer. This often occurs with broad, blanket impls. The recommendation may send the programmer down the wrong path, or the trait implementation may be an internal detail that you don't want to expose, or the bounds may not be able to be satisfied by the programmer.
570570
>
571571
> For example, in an error message about a type not implementing a required trait, the compiler may find a trait implementation that would satisfy the requirements if it weren't for specific bounds in the trait implementation. The compiler may tell the user that there is an impl, but the problem is the bounds in the trait implementation. The `#[diagnostic::do_not_recommend]` attribute can be used to tell the compiler to *not* tell the user about the trait implementation, and instead simply tell the user the type doesn't implement the required trait.
572572

0 commit comments

Comments
 (0)