Skip to content
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

Fix field_visibility not called for new-type aliases #2967

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Oct 31, 2024

The field_visibility callback is now called in case of alias new-type and new-type-deref with the type name and field_name set to "0"

This PR allows generation of different accessibility:

typedef const char *  pub_var1;
typedef const char *  pubcrate_var2;
typedef const char *  private_var3;
pub struct pub_var1(pub *const ::std::os::raw::c_char);
pub struct pubcrate_var2(pub(crate) *const ::std::os::raw::c_char);
pub struct private_var3(*const ::std::os::raw::c_char);

Fixes #2966

The `field_visibility` callback is now called in case of alias new-type and new-type-deref with the type name and field_name set to `"0"`
@nyurik nyurik changed the title Use field_visibility callback for new-type aliases Fix field_visibility not called for new-type aliases Nov 2, 2024
@pvdrz pvdrz added this pull request to the merge queue Nov 11, 2024
Merged via the queue into rust-lang:main with commit 2269982 Nov 11, 2024
33 checks passed
@nyurik nyurik deleted the fix-2966 branch November 11, 2024 05:18
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.

ParseCallbacks::field_visibility is not called for new type aliases
2 participants