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

Allow marking specific template instantiations as opaque #773

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jun 21, 2017

If a template has a specialization that bindgen doesn't understand, it can be
helpful to mark it as opaque and continue making forward progress in the
meantime. This is something we need in the SpiderMonkey bindings.

r? @emilio

@highfive
Copy link

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

// `canonical_name` does not insert the template arguments into the
// name, ie it for nested template arguments it creates "Foo" instead of
// "Foo<int>". The fully correct fix is to make `canonical_{name,path}`
// include template arguments properly.
Copy link
Member Author

Choose a reason for hiding this comment

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

For the record, I tried doing this the right way, but it's so messy because all the different places we assume names can or can't have non-ident characters and things like that. Need to file a bug to put the issue number here.

@fitzgen fitzgen mentioned this pull request Jun 21, 2017
@fitzgen fitzgen force-pushed the allow-making-particular-instantiations-opaque branch from 1fb0b32 to 90c23fb Compare June 21, 2017 22:13
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.

Err, I think I reviewed this and forgot to hit publish?

The template serialization is sort-of nasty, but I guess it's fine... r=me with issues filed and all that :)

If a template has a specialization that bindgen doesn't understand, it can be
helpful to mark it as opaque and continue making forward progress in the
meantime. This is something we need in the SpiderMonkey bindings.
@fitzgen fitzgen force-pushed the allow-making-particular-instantiations-opaque branch from 90c23fb to 2000177 Compare June 22, 2017 16:37
@fitzgen
Copy link
Member Author

fitzgen commented Jun 22, 2017

Thanks Emilio!

@bors-servo r=emilio

@bors-servo
Copy link

📌 Commit 2000177 has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 2000177 with merge 313d792...

bors-servo pushed a commit that referenced this pull request Jun 22, 2017
…paque, r=emilio

Allow marking specific template instantiations as opaque

If a template has a specialization that bindgen doesn't understand, it can be
helpful to mark it as opaque and continue making forward progress in the
meantime. This is something we need in the SpiderMonkey bindings.

r? @emilio
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: emilio
Pushing 313d792 to master...

@bors-servo bors-servo merged commit 2000177 into rust-lang:master Jun 22, 2017
@fitzgen fitzgen deleted the allow-making-particular-instantiations-opaque branch June 22, 2017 17:26
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.

None yet

4 participants