aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-07-26 23:48:13 -0700
committerHaibo Huang <hhb@google.com>2020-07-26 23:48:13 -0700
commite23d8e27aa74e468a0c3703e3b8fdd896a15d7bf (patch)
treedd36ed2ad7763fe9ee9537a2c243e99513ae2aea /README.md
parentf490e91415e81a1ead338b38bd50fbcb6387eb43 (diff)
downloadproc-macro-hack-e23d8e27aa74e468a0c3703e3b8fdd896a15d7bf.tar.gz
Upgrade rust/crates/proc-macro-hack to 0.5.18
Change-Id: I4e17bf83d28687a52026191a93e1768afc89f2ff
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 10 insertions, 6 deletions
diff --git a/README.md b/README.md
index d6a6463..df7a2ec 100644
--- a/README.md
+++ b/README.md
@@ -6,14 +6,20 @@ Procedural macros in expression position
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-proc--macro--hack-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/proc-macro-hack)
[<img alt="build status" src="https://img.shields.io/github/workflow/status/dtolnay/proc-macro-hack/CI/master?style=for-the-badge" height="20">](https://github.com/dtolnay/proc-macro-hack/actions?query=branch%3Amaster)
-As of Rust 1.30, the language supports user-defined function-like procedural
-macros. However these can only be invoked in item position, not in
-statements or expressions.
+<table><tr><td><hr>
+<b>Note:</b> <i>As of Rust 1.45 this crate is superseded by native support for
+#[proc_macro] in expression position. Only consider using this crate if you care
+about supporting compilers between 1.31 and 1.45.</i>
+<hr></td></tr></table>
+
+Since Rust 1.30, the language supports user-defined function-like procedural
+macros. However these can only be invoked in item position, not in statements or
+expressions.
This crate implements an alternative type of procedural macro that can be
invoked in statement or expression position.
-This approach works with any stable or nightly Rust version 1.31+.
+This approach works with any Rust version 1.31+.
## Defining procedural macros
@@ -33,8 +39,6 @@ The function signature is the same as for ordinary function-like procedural
macros.
```rust
-extern crate proc_macro;
-
use proc_macro::TokenStream;
use proc_macro_hack::proc_macro_hack;
use quote::quote;