-
Notifications
You must be signed in to change notification settings - Fork 143
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
#[derive] below #[salsa::tracked] is not functional? #469
Comments
Yes, |
That's intentional. The struct becomes just a thin wrapper of an id. |
You can use rust analyzer expand macro command to see what's going on. Because the fields would require a database reference to access, the derive attr for Debug Clone Copy wouldn't make any sense. And by the way, the resulting type implements quite a few trait in its own way, Debug Clone Copy PartialEq Eq Hash |
Thanks for the responses. However intentional it may be, it was surprising to me that it was just discarded. How about an error for this, indicating that this isn't supported? Not sure if that is possible, but that would remove the surprise for me. It is some time ago now, but if I recall correctly it did work when I flipped the lines:
What I mean with that it did work is that that derive seemed effective, but I may not recall this correctly (and don't have the code anymore). The previously mentioned error could mention this as fix/workaround? Thanks again! |
I would imagine a fix would be quite simple. Just run through attrs in the procedural macro. |
With salsa-2022, I noticed the following code will compile.
It seems that derive line is discarded? I didn't notice until I added a derive I actually needed.
The text was updated successfully, but these errors were encountered: