SergioBenitez / Pear

A pear is a fruit.
Apache License 2.0
50 stars 13 forks source link

pear won't compile with recent versions of nightly #1

Closed cdaringe closed 6 years ago

cdaringe commented 6 years ago

hi all. sorry if this is a non-issue for this lib, but i'm new to rust and still learning its quirks. it seems there are more than expected :$.

i get the following errors when running cargo check w/ rocket 0.3.[3|4]:

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<syntax::ast::Item>` in the current scope
  --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:72:45
   |
72 |             let mut new_item = item.clone().unwrap();
   |                                             ^^^^^^

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<syntax::ast::Expr>` in the current scope
   --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:174:40
    |
174 |     let mut param_expr = param.clone().unwrap();
    |                                        ^^^^^^

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<syntax::ast::Expr>` in the current scope
   --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:228:37
    |
228 |     let mut new_expr = expr.clone().unwrap();
    |                                     ^^^^^^

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<syntax::ast::Expr>` in the current scope
   --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:250:43
    |
250 |     let mut unwrapped_expr = expr.clone().unwrap();
    |                                           ^^^^^^

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<syntax::ast::Block>` in the current scope
   --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:345:71
    |
345 |             let new_block = gen_stmt(ecx, input, VecDeque::from(block.unwrap().stmts));
    |                                                                       ^^^^^^

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<syntax::ast::Block>` in the current scope
   --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:357:76
    |
357 |             let new_block = gen_stmt(ecx, input, VecDeque::from(true_block.unwrap().stmts));
    |                                                                            ^^^^^^

error[E0599]: no method named `unwrap` found for type `syntax::ptr::P<(syntax::codemap::Spanned<syntax::ast::Mac_>, syntax::ast::MacStmtStyle, syntax::util::ThinVec<syntax::ast::Attribute>)>` in the current scope
   --> /Users/cdieringer/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.10/src/lib.rs:429:32
    |
429 |             let mac = mac_stmt.unwrap().0;
    |                                ^^^^^^

error: aborting due to 7 previous errors

error: Could not compile `pear_codegen`.
$ rustup show
Default host: x86_64-apple-darwin

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-2017-12-10-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin

active toolchain
----------------

nightly-x86_64-apple-darwin (directory override for '/Users/cdieringer/src/truth.lol/packages/api')
rustc 1.24.0-nightly (dc39c3169 2017-12-17)

please close if this is a non issue or let me know if i can provide more info! thx

SergioBenitez commented 6 years ago

Looks like this might be breakage introduced by today's nightly. I'll take a look shortly. In the meantime, can you try using yesterday's nightly and see if the issue resolves? You can do this via something like 'rustup default nightly-2017-12-16'.

Attil commented 6 years ago

I have the same issue. Using nightly-2017-12-16-x86_64-unknown-linux-gnu fixes the issue.

SergioBenitez commented 6 years ago

Fixed in 0.0.12.