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

Compile error in bytemuck_derive #39

Closed
kvark opened this issue Sep 10, 2020 · 3 comments
Closed

Compile error in bytemuck_derive #39

kvark opened this issue Sep 10, 2020 · 3 comments

Comments

@kvark
Copy link

kvark commented Sep 10, 2020

graphics35334:wgpu-rs dmalyshau$ cargo test
    Updating crates.io index
    Updating git repository `https://github.com/gfx-rs/wgpu`
  Downloaded proc-macro2 v1.0.21
  Downloaded bytemuck v1.4.1
  Downloaded syn v1.0.40
  Downloaded bytemuck_derive v1.0.0
   Compiling proc-macro2 v1.0.21
   Compiling syn v1.0.40
   Compiling wgpu-core v0.6.0 (/Users/dmalyshau/Code/wgpu/wgpu-core)
   Compiling wgpu-types v0.6.0 (/Users/dmalyshau/Code/wgpu/wgpu-types)
   Compiling quote v1.0.3
   Compiling thiserror-impl v1.0.20
   Compiling bytemuck_derive v1.0.0
error[E0433]: failed to resolve: use of undeclared type or module `proc_macro`
  --> /Users/dmalyshau/.cargo/registry/src/github.com-1ecc6299db9ec823/bytemuck_derive-1.0.0/src/lib.rs:36:26
   |
36 | pub fn derive_pod(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
   |                          ^^^^^^^^^^ use of undeclared type or module `proc_macro`

Looks like it can't find the proc_macro thing on my machine. I wonder why?

@Lokathor
Copy link
Owner

Looking at the code, I'm noticing that they didn't write extern crate proc_macro, which used to be needed for proc macros but I vaguely recall that requirement was removed at some point... are you on an old compiler?

@kvark
Copy link
Author

kvark commented Sep 11, 2020

Yes, that was on 1.41.1. I tried on latest, and it works fine. Feel free to close, but beware of the MSRV.

@Lokathor
Copy link
Owner

I'll try to push out a patch soon. No reason to not support the farther back compilers when it's just a 1 line change needed.

leod pushed a commit to leod/bytemuck that referenced this issue Jun 3, 2023
On older compilers, you need to say `extern crate proc_macro;` even in 2018 edition. Since it doesn't hurt in newer compilers, we'll just do that.
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

2 participants