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

Tracking issue for the `thiscall` calling convention #42202

Open
froydnj opened this Issue May 24, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@froydnj
Contributor

froydnj commented May 24, 2017

Added in #42058, which fixes #42044 and related requests from other bugs.

This calling convention is the default calling convention for C++ instance methods in the (MSVC) Windows ABI. At the very least, bindgen (and its dependency syntex) need this to exist so they have a reasonable chance of representing C++ instance methods in an AST. thiscall is therefore important for the interop story between Rust and C++ on Windows.

I don't think you could actually write callable C++ instance methods in Rust for MSVC, since mangled names in MSVC contain characters that, AFAICT, are not legal in Rust identifiers ('?', for instance). But maybe there is cleverness around assigning assembly names to things that I am not aware of.

@ids1024

This comment has been minimized.

Contributor

ids1024 commented May 25, 2017

But maybe there is cleverness around assigning assembly names to things that I am not aware of.

If this doesn't exist, perhaps it warrants an RFC? In particular some kind of attribute to specify the symbol name as an alternative to no_mangle.

@froydnj

This comment has been minimized.

Contributor

froydnj commented May 25, 2017

If this doesn't exist, perhaps it warrants an RFC? In particular some kind of attribute to specify the symbol name as an alternative to no_mangle.

I think this sounds like an excellent idea!

@ids1024

This comment has been minimized.

Contributor

ids1024 commented May 25, 2017

It looks like there's already an export_name attribute that does this. That probably would work.

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