woboq / tr

Translation tools for rust
57 stars 9 forks source link

Compilation error with syn 1.0.58 and later #8

Closed der-lyse closed 3 years ago

der-lyse commented 3 years ago

I'm using commit d8e4517fb38f617b23cb050955ad8038342d6f31 (current master). The new syn version (1.0.60 in my case) breaks compilation of xtr. According to this analysis it was syn 1.0.58, which introduced a backwards-incompatible change. I didn't check any further.

error[E0432]: unresolved import `syn::export`
  --> xtr/src/main.rs:25:10
   |
25 | use syn::export::ToTokens;
   |          ^^^^^^ could not find `export` in `syn`

error[E0599]: no method named `into_token_stream` found for reference `&syn::File` in the current scope
   --> xtr/src/main.rs:266:22
    |
266 |                 file.into_token_stream(),
    |                      ^^^^^^^^^^^^^^^^^ method not found in `&syn::File`

I'm not a Rust programmer and worked around it by specifying 1.0.55, <1.0.56 as the syn dependency version in the xtr/Cargo.toml, since I had version 1.0.55 already laying around locally.

ogoffart commented 3 years ago

Thanks for your bug report. The problem is now fixed.