Skip to content

Add option to avoid wrapping function pointer fields #2361

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

Closed

Conversation

pvdrz
Copy link
Contributor

@pvdrz pvdrz commented Nov 24, 2022

Fixes #1278

@pvdrz pvdrz requested a review from emilio November 24, 2022 16:26
Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

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

So, if this works for someone, sure, that's fine. However I'd argue that this should be a per-field / argument / etc option.

E.g., I'd argue that we should try to handle cases like this:

typedef void (*_Nonnull FnPtr)();

void foo(FnPtr bar);

To avoid generating the Option<> only for those explicitly non-null cases.

@pvdrz
Copy link
Contributor Author

pvdrz commented Dec 7, 2022

I agree that it would be nicer to handle _Nonnull properly but at the same time it seems people don't use it that much (#1278 (comment)). I agree that it would be nicer to do this on a per-field basis but then we would need to pass a regex to this that matches both the struct and the field name.

@bors-servo
Copy link

☔ The latest upstream changes (presumably ed2d06e) made this pull request unmergeable. Please resolve the merge conflicts.

@pvdrz pvdrz closed this Feb 10, 2023
@pvdrz
Copy link
Contributor Author

pvdrz commented Feb 10, 2023

Closed in favor of #2370

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.

Make it possible so that function pointers aren't always wrapped in an Option.
3 participants