Skip to content

Is it always necessary to put every function definition in a separate extern block? #564

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
crumblingstatue opened this issue Mar 7, 2017 · 5 comments · Fixed by #2258
Closed
Assignees

Comments

@crumblingstatue
Copy link

Here is a diff of regenerating some bindings with servo/rust-bindgen over the old Yamakaky/rust-bindgen: jeremyletang/rust-sfml@ed4ecd7#diff-1e7d161ae38b44ab3fb4c32f7c2bdf19R371

It adds a lot of extra noise with all those extern blocks.

@emilio
Copy link
Contributor

emilio commented Mar 7, 2017

So this is done this way because after the rewrite, each parsed item is conceptually independent and can generate a rust ast::Item. The way to do this for functions is generating an extern block.

I don't think coalescing them is a priority, but I'd be happy to take a patch that does it as long as it's not a maintenance burden.

@nox
Copy link
Contributor

nox commented Mar 17, 2017

This should IMO be a top priority to fix.

@nox
Copy link
Contributor

nox commented Mar 17, 2017

I've read lots of reports from users on IRC and that was their main complaint about it.

@fitzgen
Copy link
Member

fitzgen commented Mar 17, 2017

This should IMO be a top priority to fix.

Its purely aesthetics of machine generated code that people aren't maintaining by hand... That doesn't scream "top priority" to me, but patches are ofc very welcome.

@nox
Copy link
Contributor

nox commented Mar 17, 2017

Its purely aesthetics of machine generated code that people aren't maintaining by hand...

Aesthetics matter, and changes to generated bindings are more confusing to review with all the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants