Skip to content

Commit

Permalink
readme: update for procedural macros in Rust 1.30
Browse files Browse the repository at this point in the history
Rust 1.30 added support for attribute-like procedural macros, so Rust
nightly is no longer necessary to use the `quickcheck` attribute macro
in the `quickcheck_macros` crate.

PR #231
  • Loading branch information
jturner314 authored and BurntSushi committed Feb 4, 2019
1 parent 231d07d commit 8ec8cb1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 51,23 @@ mod tests {
}
```

This example uses the `quickcheck!` macro, which is available on stable Rust.
This example uses the `quickcheck!` macro, which is backwards compatible with
old versions of Rust.

### The `#[quickcheck]` attribute (requires Rust nightly)
### The `#[quickcheck]` attribute (requires Rust 1.30 or later)

To make it easier to write QuickCheck tests, the `#[quickcheck]` attribute
will convert a property function into a `#[test]` function.

To use the `#[quickcheck]` attribute, you must enable the `plugin` feature and
import the `quickcheck_macros` crate as a syntax extension:
To use the `#[quickcheck]` attribute, you must import the `quickcheck` macro
from the `quickcheck_macros` crate:

```rust
#![feature(plugin)]
#![plugin(quickcheck_macros)]

#[cfg(test)]
extern crate quickcheck;
#[cfg(test)]
#[macro_use(quickcheck)]
extern crate quickcheck_macros;

#[cfg(test)]
mod tests {
Expand Down

0 comments on commit 8ec8cb1

Please sign in to comment.