-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Proc-macro derivative::Derivative unresolved #7459
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
Comments
[Copy from original issue] @aaomidi Confirm your bug in maybe related to #[cfg_attr(not(test), proc_macro_derive(Derivative, attributes(derivative)))]
pub fn derivative(input: TokenStream) -> TokenStream {
let mut errors = proc_macro2::TokenStream::new();
let mut output = match syn::parse::<syn::DeriveInput>(input) {
Ok(parsed) => {
ast::Input::from_ast(&parsed, &mut errors)
.map(|mut input| derive_impls(&mut input, &mut errors))
.unwrap_or_default()
},
Err(error) => {
errors.extend(error.to_compile_error());
Default::default()
}
};
output.extend(errors);
output.into()
} |
Yeah that's it. We always set |
Confirmed the bug is in stable too. Although I'm not 100% sure how to make sure rust-analyzer is running with the stable toolchain. I just used rustup to change the default and hoped for the best. |
I'm running into this as well with |
It will be fixed by the last item of #8486 :
|
8b77e26 appears to have fixed this with some manual intervention; you can now add |
I used |
I still have this issue with
|
@sunilkr Right now, you will need to use the |
Workaround from rust-lang/rust-analyzer#7459
It's been more than 1.4 years of this issue, any update on it getting resolved soon? |
There is a workaround in the comment above. |
Thanks but the workaround needs to be applied by each dev on their own. I got people looking at my crate's source (possibly contributing) and getting annoyed by my use of derivative. |
You can set it in the |
Thanks, that's much better indeed. Still that means every project having to do this. |
Is this issue fixed now? I had a project that used the |
@cyqsimon Yeah, I am unable to reproduce either. |
This is fixed now, unless you're using derivative as a path dependency. |
Not working for me unfortunately.
Settings are on true
Originally posted by @aaomidi in #6053 (comment)
The text was updated successfully, but these errors were encountered: