Skip to content

Commit ed9a517

Browse files
committed
Unwrap macro_use
1 parent 182f2c6 commit ed9a517

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/macros-by-example.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ r[macro.decl.scope.macro_use]
330330
### The `macro_use` attribute
331331

332332
r[macro.decl.scope.macro_use.mod-decl]
333-
The *`macro_use` attribute* has two purposes. First, it can be used to make a
334-
module's macro scope not end when the module is closed, by applying it to a
335-
module:
333+
The *`macro_use` attribute* has two purposes. First, it can be used to make a module's macro scope not end when the module is closed, by applying it to a module:
336334

337335
```rust
338336
#[macro_use]
@@ -346,14 +344,7 @@ m!();
346344
```
347345

348346
r[macro.decl.scope.macro_use.prelude]
349-
Second, it can be used to import macros from another crate, by attaching it to
350-
an `extern crate` declaration appearing in the crate's root module. Macros
351-
imported this way are imported into the [`macro_use` prelude], not textually,
352-
which means that they can be shadowed by any other name. While macros imported
353-
by `#[macro_use]` can be used before the import statement, in case of a
354-
conflict, the last macro imported wins. Optionally, a list of macros to import
355-
can be specified using the [MetaListIdents] syntax; this is not supported
356-
when `#[macro_use]` is applied to a module.
347+
Second, it can be used to import macros from another crate, by attaching it to an `extern crate` declaration appearing in the crate's root module. Macros imported this way are imported into the [`macro_use` prelude], not textually, which means that they can be shadowed by any other name. While macros imported by `#[macro_use]` can be used before the import statement, in case of a conflict, the last macro imported wins. Optionally, a list of macros to import can be specified using the [MetaListIdents] syntax; this is not supported when `#[macro_use]` is applied to a module.
357348

358349
<!-- ignore: requires external crates -->
359350
```rust,ignore
@@ -365,8 +356,7 @@ lazy_static!{}
365356
```
366357

367358
r[macro.decl.scope.macro_use.export]
368-
Macros to be imported with `macro_use` must be exported with
369-
[`macro_export`][macro.decl.scope.macro_export].
359+
Macros to be imported with `macro_use` must be exported with [`macro_export`][macro.decl.scope.macro_export].
370360

371361
<!-- template:attributes -->
372362
r[macro.decl.scope.macro_export]

0 commit comments

Comments
 (0)