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 `external` behavior is the default for macros that don't have this attribute, unless they are built-in macros.
174
174
For built-in macros the default is `yes`.
175
175
176
-
> **Note**: `rustc` has a `-C collapse-macro-debuginfo` CLI option to override both the default collapsing behavior and `#[collapse_debuginfo]` attributes.
176
+
> [!NOTE]
177
+
> `rustc` has a `-C collapse-macro-debuginfo` CLI option to override both the default collapsing behavior and `#[collapse_debuginfo]` attributes.
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.
560
566
561
-
> **Note**: Suppressing the recommendation can be useful if you know that the recommendation would normally 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.
567
+
> [!NOTE]
568
+
> Suppressing the recommendation can be useful if you know that the recommendation would normally 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.
562
569
>
563
570
> 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.
Copy file name to clipboardExpand all lines: src/behavior-considered-undefined.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,8 @@ r[undefined.runtime]
101
101
* For assumptions specifically related to unwinding, see the [panic documentation][unwinding-ffi].
102
102
* The runtime assumes that a Rust stack frame is not deallocated without executing destructors for local variables owned by the stack frame. This assumption can be violated by C functions like `longjmp`.
103
103
104
-
> **Note**: Undefined behavior affects the entire program. For example, calling
104
+
> [!NOTE]
105
+
> Undefined behavior affects the entire program. For example, calling
105
106
> a function in C that exhibits undefined behavior of C means your entire
106
107
> program contains undefined behaviour that can also affect the Rust code. And
107
108
> vice versa, undefined behavior in Rust can cause adverse affects on code
0 commit comments