BurntSushi / quickcheck

Automated property based testing for Rust (with shrinking).
The Unlicense
2.4k stars 149 forks source link

error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 6 fields #210

Closed ghost closed 6 years ago

ghost commented 6 years ago

This is my first time using quickcheck_macros 0.6.2 in a project. With and without implementing any quickcheck tests or invoking #[quickcheck], having quickcheck_macros as a dev-dependency and running cargo test produces the following error:

   Compiling quickcheck v0.6.2
   Compiling quickcheck_macros v0.6.2
error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 6 fields
  --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/quickcheck_macros-0.6.2/src/lib.rs:56:9
   |
56 |         ItemKind::Fn(ref decl, header, _, _) => {
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 6 fields, found 4
error: aborting due to previous error
For more information about this error, try `rustc --explain E0023`.
error: Could not compile `quickcheck_macros`.
warning: build failed, waiting for other jobs to finish...
error: build failed
BurntSushi commented 6 years ago

I personally don't maintain quickcheck_macros, but will merge pull requests that fix it.

In general, the goal is to track the latest nightly.

My guess is that you aren't using the latest nightly. If that's not the case, and quickcheck_macros is broken on the latest nightly, then PRs are welcome to fix it.

If you don't want to deal with APIs that rely on nightly but still want convenient quickchecking (this would be my recommendation), then use the quickcheck macro.