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

Getting "the trait bound proc_macro2::Span: From<proc_macro::Span> is not satisfied" error when building #10

Open
edwincoronado opened this issue Dec 21, 2021 · 1 comment

Comments

@edwincoronado
Copy link

I have a project in which one of the dependencies is using this (proc-macro-error) library, when I run cargo build --release I get the following error:

sh-4.2# cargo build --release
    Updating git repository `https://github.com/swc-project/swc`
    Updating git submodule `https://github.com/tc39/test262-parser-tests.git`
   Compiling serde_derive v1.0.132
   Compiling tracing-attributes v0.1.18
   Compiling thiserror-impl v1.0.30
   Compiling proc-macro-error v1.0.4
error[E0277]: the trait bound `proc_macro2::Span: From<proc_macro::Span>` is not satisfied
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:549:37
    |
549 |                 first: self.clone().into(),
    |                                     ^^^^ the trait `From<proc_macro::Span>` is not implemented for `proc_macro2::Span`
    |
    = note: required because of the requirements on the impl of `Into<proc_macro2::Span>` for `proc_macro::Span`

error[E0277]: the trait bound `proc_macro2::Span: From<proc_macro::Span>` is not satisfied
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:550:36
    |
550 |                 last: self.clone().into(),
    |                                    ^^^^ the trait `From<proc_macro::Span>` is not implemented for `proc_macro2::Span`
    |
    = note: required because of the requirements on the impl of `Into<proc_macro2::Span>` for `proc_macro::Span`

This is happening both on MacOS and Centos (Linux)
System info:
CentOS Linux release 7.9.2009 (Core)
cargo 1.57.0 (b2e52d7ca 2021-10-21)
rustc 1.57.0 (f1edd0429 2021-11-29)
proc-macro-error v1.0.4

@edwincoronado
Copy link
Author

Update: I was able to workaround this by running rustup default nightly and re-running cargo build --release

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

1 participant