Skip to content

Commit 1f7d176

Browse files
authored
Merge pull request #815 from ehuss/fix-proc-macro-with-cargo
Fix note about using proc_macro with Cargo.
2 parents c60a418 + afcf00b commit 1f7d176

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/items/extern-crates.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,19 @@ prelude lookups within that module.
7171
> Beginning in the 2018 edition, [use declarations] can reference crates in
7272
> the extern prelude, so it is considered unidiomatic to use `extern crate`.
7373
74-
> **Note**: Additional crates that ship with `rustc`, such as [`proc_macro`],
75-
> [`alloc`], and [`test`], are not automatically included with the `--extern`
76-
> flag when using Cargo. They must be brought into scope with an `extern
77-
> crate` declaration, even in the 2018 edition.
74+
> **Note**: Additional crates that ship with `rustc`, such as [`alloc`], and
75+
> [`test`], are not automatically included with the `--extern` flag when using
76+
> Cargo. They must be brought into scope with an `extern crate` declaration,
77+
> even in the 2018 edition.
7878
>
7979
> ```rust
80-
> extern crate proc_macro;
81-
> use proc_macro::TokenStream;
80+
> extern crate alloc;
81+
> use alloc::rc::Rc;
8282
> ```
8383
8484
<!--
85-
The proc_macro/alloc/test limitation may be lifted if the `--extern`
86-
flag is stabilized and used. See tracking issue
87-
https://github.com/rust-lang/rust/issues/57288 and the unstable
88-
`--extern` flag added in https://github.com/rust-lang/rust/pull/54116.
85+
See https://github.com/rust-lang/rust/issues/57288 for more about the
86+
alloc/test limitation.
8987
-->
9088
9189
## Underscore Imports
@@ -110,6 +108,5 @@ crate to access only its macros.
110108
[`alloc`]: https://doc.rust-lang.org/alloc/
111109
[`no_implicit_prelude`]: modules.md#prelude-items
112110
[`no_std`]: ../crates-and-source-files.md#preludes-and-no_std
113-
[`proc_macro`]: https://doc.rust-lang.org/proc_macro/
114111
[`test`]: https://doc.rust-lang.org/test/
115112
[use declarations]: use-declarations.md

0 commit comments

Comments
 (0)