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.
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.
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!
It looks like there's already an export_name attribute that does this. That probably would work.
Triage: not aware of any movement on stabilizing this.
not aware of any movement on stabilizing _this_
I see what you did there, and I like it.
More seriously, I'm just swinging by to say I use this feature independently of bindgen, and I hope it's stabilized one day (or at least sticks around in some form)
What's blocking stabilization of this?
Most helpful comment
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.