syn icon indicating copy to clipboard operation
syn copied to clipboard

tauri install occurs error"the trait `From<proc_macro::TokenStream>` is not implemented"

Open Liiked opened this issue 2 years ago • 1 comments

Platform: Window10 1909

I followed tauri doc to run a demo but failed. Run npm run tauri dev to reproduce

error[E0277]: the trait bound `proc_macro2::TokenStream: From<proc_macro::TokenStream>` is not satisfied
   --> C:\Users\yuanqian.lin\.cargo\registry\src\github.com-1ecc6299db9ec823\syn-1.0.98\src\buffer.rs:122:27
    |
122 |         Self::new2(stream.into())
    |                           ^^^^ the trait `From<proc_macro::TokenStream>` is not implemented for `proc_macro2::TokenStream`
    |
    = help: the following implementations were found:
              <proc_macro2::TokenStream as From<proc_macro2::TokenTree>>
    = note: required because of the requirements on the impl of `Into<proc_macro2::TokenStream>` for `proc_macro::TokenStream`

error[E0277]: the trait bound `proc_macro2::TokenStream: From<proc_macro::TokenStream>` is not satisfied
    --> C:\Users\yuanqian.lin\.cargo\registry\src\github.com-1ecc6299db9ec823\syn-1.0.98\src\parse.rs:1164:21
     |
1164 |         self.parse2(proc_macro2::TokenStream::from(tokens))
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<proc_macro::TokenStream>` is not implemented for `proc_macro2::TokenStream`
     |
     = help: the following implementations were found:
               <proc_macro2::TokenStream as From<proc_macro2::TokenTree>>

   Compiling markup5ever v0.10.1
   Compiling ico v0.1.0
For more information about this error, try `rustc --explain E0277`.
error: could not compile `syn` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Liiked avatar Jul 01 '22 09:07 Liiked

解决了吗、?

huqingwei311 avatar Aug 02 '22 07:08 huqingwei311

I prefer not to run npm on my machine so I didn't try reproducing this, but if anyone figures out what was going on to cause this, I would be prepared to consider a PR. Thanks!

dtolnay avatar Jan 23 '23 05:01 dtolnay