jam1garner / binrw

A Rust crate for helping parse and rebuild binary data using ✨macro magic✨.
https://binrw.rs
MIT License
545 stars 35 forks source link

Cannot use binrw 0.12.0 #224

Closed Talon1024 closed 10 months ago

Talon1024 commented 10 months ago

I can't use binrw 0.12.0. Apparently, there's a compile error with binrw_derive, the procedural macro crate for binrw:

Compiling binrw_derive v0.12.0
error[E0599]: no method named `source_text` found for struct `proc_macro2::Span` in the current scope
  --> /home/~~~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/binrw_derive-0.12.0/src/binrw/backtrace/mod.rs:32:39
   |
32 |         if let Some(text) = self.span.source_text() {
   |                                       ^^^^^^^^^^^ method not found in `Span`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `binrw_derive` (lib) due to previous error
csnover commented 10 months ago

Could you please give the version of rustc you are using? Thanks!

Talon1024 commented 10 months ago

Rustc 1.72.1, stable toolchain

csnover commented 10 months ago

OK. Please try running cargo update and try again. I guess that you have a very old proc-macro2 dependency and the dependency list was not updated with a correct minimum version for the API that binrw uses. Please let me know how it goes. I will be committing changes to specify new minimums for future binrw versions. Thanks!