Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Could not compile by docopt_macros error at macro.rs line 187 #234

Open
hgsgtk opened this issue Dec 9, 2017 · 1 comment
Open

Could not compile by docopt_macros error at macro.rs line 187 #234

hgsgtk opened this issue Dec 9, 2017 · 1 comment

Comments

@hgsgtk
Copy link

hgsgtk commented Dec 9, 2017

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.

@hgsgtk hgsgtk changed the title Could not compile by docopt_macros error at line 187 Could not compile by docopt_macros error at macro.rs line 187 Dec 9, 2017
@BurntSushi
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants