Skip to content

derive: Give access to field attributes in ext::deriving #25027

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

Merged
merged 3 commits into from
May 2, 2015

Conversation

Manishearth
Copy link
Member

Adds an attrs field to FieldInfo which lets one check the attributes on
a field whilst expanding.

This lets deriving plugins be more robust, for example providing the ability to
"ignore" a field for the purpose of deriving, or perhaps handle the field a
different way.

r? @huonw

@@ -378,7 +380,7 @@ impl<'a> TraitDef<'a> {
pub fn expand(&self,
cx: &mut ExtCtxt,
mitem: &ast::MetaItem,
item: &ast::Item,
item: &'a ast::Item,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental whitespace?

@huonw
Copy link
Member

huonw commented May 2, 2015

r=me with the whitespace fix. Also, tidy failed on travis.

@Manishearth
Copy link
Member Author

@bors: r=huonw

@bors
Copy link
Collaborator

bors commented May 2, 2015

📌 Commit 5892b40 has been approved by huonw

@bors
Copy link
Collaborator

bors commented May 2, 2015

⌛ Testing commit 5892b40 with merge 354d16b...

bors added a commit that referenced this pull request May 2, 2015
Adds an `attrs` field to `FieldInfo` which lets one check the attributes on
a field whilst expanding.

This lets deriving plugins be more robust, for example providing the ability to
"ignore" a field for the purpose of deriving, or perhaps handle the field a
different way.


r? @huonw
@bors bors merged commit 5892b40 into rust-lang:master May 2, 2015
@Manishearth Manishearth deleted the deriving_attr branch May 6, 2015 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants