Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up#[derive(Copy="something")] should be rejected #21435
Comments
This comment has been minimized.
This comment has been minimized.
|
cc @nick29581 |
nrc
added
the
A-diagnostics
label
Jan 20, 2015
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
I could add a fix in #21265. Or do you prefer that I open a new PR for that? |
This comment has been minimized.
This comment has been minimized.
|
new PR please |
This comment has been minimized.
This comment has been minimized.
|
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. |
nrc
added
the
I-nominated
label
Jan 20, 2015
This comment has been minimized.
This comment has been minimized.
|
I think we have this problem throughout attribute handling code and not just on |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
many cases like this in the compiler where we are not vigilent about rejecting malformed attributes. |
pnkfelix
added this to the 1.0 milestone
Jan 22, 2015
brson
added
the
E-easy
label
Jan 22, 2015
This comment has been minimized.
This comment has been minimized.
|
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. |
pnkfelix
added
P-low
and removed
I-nominated
labels
Jan 22, 2015
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
I have updated the list of attributes (added |
This comment has been minimized.
This comment has been minimized.
|
This appears to be fixed; closing. |
aochagavia commentedJan 20, 2015
This compiles:
Other wrong attributes: