-
Notifications
You must be signed in to change notification settings - Fork 13.4k
#[derive(Copy="something")] should be rejected #21435
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
cc @nick29581 |
I don't think it is intentional, the derive parser will collect arguments, and then the copy or clone impls will silently ignore them. It would be good to error or warn if we can here. |
I could add a fix in #21265. Or do you prefer that I open a new PR for that? |
new PR please |
I guess this is technically a backwards incompatible change, since it will break programs with extraneous params. Although it is also just a bug. In any case, nomintating. |
I think we have this problem throughout attribute handling code and not just on |
I have updated the code example, since it is also possible to do I think the problem is in L61 and L62. We should only accept |
many cases like this in the compiler where we are not vigilent about rejecting malformed attributes. |
polish issue, where it would not be the end of the world if we did not get around to addressing it, though it would be nice if it were fixed. Assigning 1.0, P-low. |
I think people will cut us a little slack on backwards compatibility of crap like #[derive(Clone="2", Show(Wrong))] The only way I could see this mattering is if a plugin makes an ill-advised attempt to extend the |
I have updated the list of attributes (added |
This appears to be fixed; closing. |
This compiles:
Other wrong attributes:
The text was updated successfully, but these errors were encountered: