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

Generated name override #2228

Merged
merged 5 commits into from
Oct 6, 2022
Merged

Conversation

justsmth
Copy link
Contributor

Addresses issue: #1375

  • Adds generated_name_override callback to the ParseCallbacks trait.
  • Callback is invoked for each function name (after other name-related logic).
  • Added test to verify.

This PR is a cleaned up version of previous: #2214

tests/parse_callbacks/mod.rs Outdated Show resolved Hide resolved
@pvdrz
Copy link
Contributor

pvdrz commented Sep 9, 2022

@justsmth I have one question. What happens if you use this new callback to set all the function names to the same value?

@justsmth
Copy link
Contributor Author

justsmth commented Sep 9, 2022

@justsmth I have one question. What happens if you use this new callback to set all the function names to the same value?

I've not tried that, but at best the bindings generated would not compile due to name conflicts. We could potentially detect/prevent such a mistake within rust-bindgen. However, I'm not sure doing so would be worth the added complexity.

@justsmth justsmth requested a review from pvdrz September 9, 2022 21:36
src/ir/function.rs Outdated Show resolved Hide resolved
@bors-servo
Copy link

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

@pvdrz pvdrz merged commit 63bf643 into rust-lang:master Oct 6, 2022
@justsmth justsmth deleted the generated_name_override branch October 7, 2022 13:42
@pvdrz pvdrz mentioned this pull request Nov 11, 2022
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