Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unresolved import #365

Closed
wcampbell0x2a opened this issue Apr 15, 2020 · 6 comments
Closed

unresolved import #365

wcampbell0x2a opened this issue Apr 15, 2020 · 6 comments

Comments

@wcampbell0x2a
Copy link

having the following problem when compiling this library:

   Compiling rustyline-derive v0.3.1
error[E0432]: unresolved import `proc_macro`
 --> /home/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/rustyline-derive-0.3.1/src/lib.rs:1:5
  |
1 | use proc_macro::TokenStream;
  |     ^^^^^^^^^^ help: a similar path exists: `syn::proc_macro`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.
error: could not compile `rustyline-derive`.
To learn more, run the command again with --verbose.
@bjorn3
Copy link
Contributor

bjorn3 commented Apr 15, 2020

Which version of rust are you using? (rustc -V)

@gwenn
Copy link
Collaborator

gwenn commented Apr 15, 2020

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 15, 2020

rustyline-derive requires the 2018 edition of rust, which was introduced in rustc 1.31.

@gwenn
Copy link
Collaborator

gwenn commented Apr 15, 2020

@bjorn3 Sorry, you are right.

@hibachrach
Copy link

hibachrach commented Apr 28, 2020

I'm encountering this after cloning and running examples. Normal cargo build works fine. Sorry, that's just for the top level crate, not for rustyline-derive.

$ rustc -V
rustc 1.41.0
$ cargo -V
cargo 1.41.0

EDIT: This is resolved when extern crate proc_macro; is prepended to the offending file rustyline-derive/src/lib.rs.

EDIT 2: It seems this is intended?

@gwenn
Copy link
Collaborator

gwenn commented Apr 28, 2020

rust-lang/cargo#7700
=> cargo 1.42

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

No branches or pull requests

4 participants