Skip to content

Commit d040583

Browse files
ehusstraviscross
authored andcommitted
Update macro_use for updated attribute template
1 parent db5285f commit d040583

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/macros-by-example.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ r[macro.decl.scope.macro_use.export]
368368
Macros to be imported with `macro_use` must be exported with
369369
[`macro_export`][macro.decl.scope.macro_export].
370370

371+
<!-- template:attributes -->
371372
r[macro.decl.scope.macro_export]
372373
### The `macro_export` attribute
373374

@@ -399,13 +400,13 @@ r[macro.decl.scope.macro_export.allowed-positions]
399400
The `macro_export` attribute may be applied to `macro_rules` definitions.
400401
401402
> [!NOTE]
402-
> `rustc` currently warns in other positions, but this may be rejected in the future.
403+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
403404
404405
r[macro.decl.scope.macro_export.duplicates]
405-
Only the first instance of `macro_export` on a macro is honored. Subsequent `macro_export` attributes are ignored.
406+
Only the first use of `macro_export` on a macro has effect.
406407
407408
> [!NOTE]
408-
> `rustc` currently warns on subsequent duplicate `macro_export` attributes.
409+
> `rustc` lints against any use following the first.
409410
410411
r[macro.decl.scope.macro_export.path-based]
411412
By default, macros only have [textually-based scoping](#textual-scope). When the `macro_export` attribute is used, the macro is reexported in the crate root, and can be referred to using a path to the macro in the crate root.

0 commit comments

Comments
 (0)