You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using ramhorns in my project: I have a use case where I need to use both syn and ramhorn together.
Following is the minimal reproducible example:
use syn::Result;use ramhorns::{Content};#[derive(Content)]structPost<'a>{title:&'astr}
But, On running cargo build, I get the following error:
error[E0107]: wrong number of type arguments: expected 1, found 2
--> src/main.rs:53:10
|
53 |#[derive(Content)]| ^^^^^^^ unexpected type argument
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error; 7 warnings emitted
For more information about this error, try `rustc --explain E0107`.
From what i understand, The code generated by ramhorn-derive generates Result<...> on Content's traits methods and that clashes with syn::Result. And as you can see the error message is also misleading.
What's the best way to solve this? I could alias my import of syn, but consider a larger project which imports ramhorn and derive and also has a syn::Result imported already, they might not know where to look for this error. As my example was small, I was able remove code incrementally and figured this out.
The text was updated successfully, but these errors were encountered:
That should be fairly simple to fix, the derive macro just needs to explicitly produce std::result::Result instead of Result in the output token stream.
Hi @maciejhirsz
Thank you for this library!
While using
ramhorns
in my project: I have a use case where I need to use bothsyn
andramhorn
together.Following is the minimal reproducible example:
But, On running
cargo build
, I get the following error:From what i understand, The code generated by
ramhorn-derive
generatesResult<...>
onContent
's traits methods and that clashes with syn::Result. And as you can see the error message is also misleading.What's the best way to solve this? I could alias my import of syn, but consider a larger project which imports ramhorn and derive and also has a
syn::Result
imported already, they might not know where to look for this error. As my example was small, I was able remove code incrementally and figured this out.The text was updated successfully, but these errors were encountered: