Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.
This repository was 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

@hgsgtk

Description

@hgsgtk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions