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

Runtime exception #210

Closed
johannessarpola opened this issue Feb 7, 2017 · 2 comments
Closed

Runtime exception #210

johannessarpola opened this issue Feb 7, 2017 · 2 comments

Comments

@johannessarpola
Copy link

johannessarpola commented Feb 7, 2017

There's compilation error with the rustc 1.16.0-nightly and docopt-macros 0.7

Caused by this:

    // macro.rs, row 314
    let tystr = ast::AngleBracketedParameterData {
        lifetimes: vec![],
        types: P::from_vec(vec![cx.ty_ident(sp, ident("String"))]),
        bindings: P::new(),
    };

Error was:

   Compiling docopt_macros v0.6.88 error[E0308]: mismatched types
   --> ...\registry\src\github.com-1ecc6299db9ec823\docopt_macros-0.6.88\src/macro.rs:316:16
    |
316 |         types: P::from_vec(vec![cx.ty_ident(sp, ident("String"))]),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found struct `syntax::ptr::P`

And following compiler suggestion I got this to work with this:

    // macro.rs, row 314
    let tystr = ast::AngleBracketedParameterData {
        lifetimes: vec![],
        types: P::from_vec(vec![cx.ty_ident(sp, ident("String"))]).into_vec(),
        bindings: P::new().into_vec(),
    };

Not really a pro with Rust so don't know for wider consequences on this, but just stumbled on this when doing the 24 days of rust guide.

@johannessarpola johannessarpola changed the title Compilation error Runtime exception Feb 7, 2017
@koba-e964
Copy link

#209 seems to resolve this issue. Let's wait until it's merged :)

@johannessarpola
Copy link
Author

Great 👍

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