docopt.rs
docopt.rs copied to clipboard
Could not compile by docopt_macros error at macro.rs line 187
When I try to use docopt_macros v0.8.1, I found compile error like that,
-> % cargo run
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling docopt_macros v0.8.1
error[E0308]: mismatched types
--> /Users/Khigashiguchi/.cargo/registry/src/github.com-1ecc6299db9ec823/docopt_macros-0.8.1/src/macro.rs:187:20
|
187 | .map(|(ident, ty)| {
| ^^^^^^^^^^^ expected struct `std::vec::Vec`, found tuple
|
= note: expected type `std::vec::Vec<(syntax::ast::Ident, syntax::ptr::P<syntax::ast::Ty>)>`
found type `(_, _)`
error: aborting due to previous error
error: Could not compile `docopt_macros`.
My code is above...
- src/main.rs
#![feture(plugin)]
#![plugin(docopt_macros)]
#[macro_use]
extern crate serde_derive;
extern crate docopt;
use docopt::Docopt;
docopt!(Args derive Debug, "
Usage:
cref
cref import <import-repo>...
cref list
cref update [<update-repo>...]
cref delete <delete-repo>
cref (--help | --version)
Options:
-h, --help Show this screen
-v, --version Show version
");
fn main() {
let args: Args = Args::docopt().deserialize().unwrap_or_else(|e| e.exit());
println!("{:?}", args);
}
- Cargo.toml
[package]
name = "cli_search_proper_english_message"
version = "0.1.0"
authors = ["Khigashiguchi"]
[dependencies]
docopt = "0.8"
docopt_macros = "*"
serde = "1.0"
serde_derive = "1.0"
cargo --version
cargo 0.24.0-nightly (5bb478a51 2017-11-29)
rustc --version
rustc 1.24.0-nightly (1956d5535 2017-12-03)
Please teach me how to solve it.
In the future, please search the issue tracker for similar issues: https://github.com/docopt/docopt.rs/issues?utf8=%E2%9C%93&q=is%3Aissue+docopt_macros
docopt_macros
relies on an unstable compiler plugin interface. It breaks somewhat regularly, and I don't have the time to maintain it. I take PRs that fix it, but otherwise, you're on your own. If stability is important to you, then don't use docopt_macros
.