File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/coding-guidelines/macros Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 44 .. default-domain :: coding-guidelines
55
66Do 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 {
You can’t perform that action at this time.
0 commit comments