Skip to content

Add annotation-based custom field attributes support#3198

Open
ekoops wants to merge 2 commits into
rust-lang:mainfrom
ekoops:ekoops/field-attributes
Open

Add annotation-based custom field attributes support#3198
ekoops wants to merge 2 commits into
rust-lang:mainfrom
ekoops:ekoops/field-attributes

Conversation

@ekoops

@ekoops ekoops commented Apr 26, 2025

Copy link
Copy Markdown

This PR adds support for specifying custom field attributes through annotations.

Given the following input,

struct S {
    /// <div rustbindgen attribute="#[Attr1] #[Attr2]" attribute="#[Attr3(value)]"></div>
    int field_1;
    char field_2;
};

the generated bindings will contain the specified attributes

pub struct S {
    /// <div rustbindgen attribute="#[Attr1] #[Attr2]" attribute="#[Attr3(value)]"></div>
    #[Attr1]
    #[Attr2]
    #[Attr3(value)]
    pub field_1: ::std::os::raw::c_int,
    pub field_2: ::std::os::raw::c_char,
}

@ekoops ekoops force-pushed the ekoops/field-attributes branch 3 times, most recently from 9a91261 to 79437a5 Compare April 26, 2025 16:09
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
@ekoops ekoops force-pushed the ekoops/field-attributes branch from 79437a5 to f1860bd Compare April 26, 2025 16:34
@ekoops

ekoops commented Apr 26, 2025

Copy link
Copy Markdown
Author

r? @emilio

@rustbot

rustbot commented Apr 26, 2025

Copy link
Copy Markdown
Collaborator

Error: The feature assign is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@ekoops

ekoops commented May 22, 2025

Copy link
Copy Markdown
Author

Hey! Is there any chance this patch will get considered any soon?

@rustbot

rustbot commented May 4, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #3365) made this pull request unmergeable. Please resolve the merge conflicts.

@ekoops

ekoops commented May 12, 2026

Copy link
Copy Markdown
Author

I guess the support has been added here: #3307.
Can anyone confirm? If confirmed, I'll happy to close this.

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.

2 participants