-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement #[deriving]
meta-attribute
#5320
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
Conversation
Actually, I just realized that two of the spans are wrong for reporting the warning and the second error. Can I just add the fix commit to this pull request? |
@apasel422: You can another commit, or you could rebase the existing ones - github just ties a pull request to a branch. |
@thestinger: Thanks. I was just wondering if it would affect bors. I'll rebase shortly. |
The span issue should be fixed now, and the patch has been squashed into a single commit. |
I assume the two failures are related to why |
The failing test is now marked |
This is the first in a series of patches I'm working on to clean up the code related to `deriving`. This patch allows ``` #[deriving_eq] #[deriving_iter_bytes] #[deriving_clone] struct Foo { bar: uint } ``` to be replaced with: ``` #[deriving(Eq, IterBytes, Clone)] struct Foo { bar: uint } ``` It leaves the old attributes alone for the time being. Eventually I'd like to incorporate the new closest-match-suggestion infrastructure for mistyped trait names, and also pass the sub-attributes to the deriving code, so that the following will be possible: ``` #[deriving(TotalOrd(qux, bar))] struct Foo { bar: uint, baz: char, qux: int } ``` This says to derive an `impl` in which the objects' `qux` fields are compared first, followed by `bar`, while `baz` is ignored in the comparison. If no fields are specified explicitly, all fields will be compared in the order they're defined in the `struct`. This might also be useful for `Eq`. Coming soon.
This is the first in a series of patches I'm working on to clean up the code related to
deriving
. This patch allowsto be replaced with:
It leaves the old attributes alone for the time being.
Eventually I'd like to incorporate the new closest-match-suggestion infrastructure for mistyped trait names, and also pass the sub-attributes to the deriving code, so that the following will be possible:
This says to derive an
impl
in which the objects'qux
fields are compared first, followed bybar
, whilebaz
is ignored in the comparison. If no fields are specified explicitly, all fields will be compared in the order they're defined in thestruct
. This might also be useful forEq
. Coming soon.