Skip to content

Commit 504fa8c

Browse files
committed
Update to use only derive(unsafe(DangerousDeriveMacro)) to match RFC 3715
1 parent d448d19 commit 504fa8c

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

text/3698-declarative-derive-macros.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@ If a derive macro mistakenly emits the token stream it was applied to
7070
the duplicate item should hint to the user that the macro was defined
7171
incorrectly, and remind the user that derive macros only append new items.
7272

73-
A `derive()` rule can be marked as `unsafe`: `unsafe derive() (...)
74-
=> { ... }`. Invoking such a derive using a rule marked as unsafe
75-
requires unsafe derive syntax: either
76-
`#[unsafe(derive(DangerousTrait))]` or
77-
`#[derive(unsafe(DangerousTrait))]`. (The latter syntax allows
78-
isolating the `unsafe` to a single derive within a list of
79-
derives.) Invoking an unsafe derive rule without the unsafe derive
80-
syntax will produce a compiler error. Using the unsafe derive
81-
syntax without an unsafe derive will trigger an "unused unsafe"
82-
lint. (RFC 3715 defines the equivalent mechanism for proc macro
83-
derives.)
73+
A `derive()` rule can be marked as `unsafe`:
74+
`unsafe derive() (...) => { ... }`.
75+
Invoking such a derive using a rule marked as `unsafe`
76+
requires `unsafe` derive syntax:
77+
`#[derive(unsafe(DangerousDeriveMacro))]`
78+
79+
Invoking an unsafe derive rule without the unsafe derive syntax will produce a
80+
compiler error. Using the unsafe derive syntax without an unsafe derive will
81+
trigger an "unused unsafe" lint. (RFC 3715 defines the equivalent mechanism for
82+
proc macro derives.)
8483

8584
# Reference-level explanation
8685
[reference-level-explanation]: #reference-level-explanation

0 commit comments

Comments
 (0)