Skip to content

Commit 84c32f4

Browse files
committed
fix: add miri options to macro guideline examples
1 parent 262bda9 commit 84c32f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/coding-guidelines/macros/gui_FRLaMIMb4t3S.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.. default-domain:: coding-guidelines
55

66
Do not hide unsafe code in macros
7-
================================
7+
===================================
88

99
.. guideline:: Do not hide unsafe code in macros
1010
:id: gui_FRLaMIMb4t3S
@@ -33,6 +33,7 @@ Do not hide unsafe code in macros
3333
This noncompliant example defines a ``deref_ptr`` macro that performs an unsafe pointer dereference.
3434

3535
.. rust-example::
36+
:miri:
3637

3738
// This macro hides the unsafe token from callers - noncompliant
3839
macro_rules! deref_ptr {
@@ -54,9 +55,10 @@ Do not hide unsafe code in macros
5455

5556
This compliant example requires the caller to wrap the macro invocation in an ``unsafe`` block,
5657
making the use of unsafe code obvious at the call site.
57-
Visibility can be further improved by prefixing the identifier for each unsafe macro with the string "unsafe_".
58+
Visibility can be further improved by prefixing the identifier for each unsafe macro with the string ``unsafe_``.
5859

5960
.. rust-example::
61+
:miri:
6062

6163
// This macro requires the caller to acknowledge the unsafe operation - compliant
6264
macro_rules! unsafe_deref_ptr {

0 commit comments

Comments
 (0)