|
1 |
| -//! A "shim crate" intended to multiplex the `proc_macro` API on to stable Rust. |
| 1 | +//! A "shim crate" intended to multiplex the [`proc_macro`] API on to stable |
| 2 | +//! Rust. |
2 | 3 | //!
|
3 | 4 | //! Procedural macros in Rust operate over the upstream
|
4 |
| -//! `proc_macro::TokenStream` type. This type currently is quite conservative |
5 |
| -//! and exposed no internal implementation details. Nightly compilers, however, |
6 |
| -//! contain a much richer interface. This richer interface allows fine-grained |
7 |
| -//! inspection of the token stream which avoids stringification/re-lexing and |
8 |
| -//! also preserves span information. |
| 5 | +//! [`proc_macro::TokenStream`][ts] type. This type currently is quite |
| 6 | +//! conservative and exposed no internal implementation details. Nightly |
| 7 | +//! compilers, however, contain a much richer interface. This richer interface |
| 8 | +//! allows fine-grained inspection of the token stream which avoids |
| 9 | +//! stringification/re-lexing and also preserves span information. |
9 | 10 | //!
|
10 |
| -//! The upcoming APIs added to `proc_macro` upstream are the foundation for |
| 11 | +//! The upcoming APIs added to [`proc_macro`] upstream are the foundation for |
11 | 12 | //! productive procedural macros in the ecosystem. To help prepare the ecosystem
|
12 | 13 | //! for using them this crate serves to both compile on stable and nightly and
|
13 | 14 | //! mirrors the API-to-be. The intention is that procedural macros which switch
|
14 | 15 | //! to use this crate will be trivially able to switch to the upstream
|
15 | 16 | //! `proc_macro` crate once its API stabilizes.
|
16 | 17 | //!
|
17 | 18 | //! In the meantime this crate also has a `nightly` Cargo feature which
|
18 |
| -//! enables it to reimplement itself with the unstable API of `proc_macro`. |
| 19 | +//! enables it to reimplement itself with the unstable API of [`proc_macro`]. |
19 | 20 | //! This'll allow immediate usage of the beneficial upstream API, particularly
|
20 | 21 | //! around preserving span information.
|
| 22 | +//! |
| 23 | +//! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/ |
| 24 | +//! [ts]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html |
21 | 25 |
|
22 | 26 | // Proc-macro2 types in rustdoc of other crates get linked to here.
|
23 | 27 | #![doc(html_root_url = "https://docs.rs/proc-macro2/0.2.2")]
|
|
0 commit comments