Are the rust implementation details in any way documented outside of the source code? I’ve been trying to find information on calling conventions (ABI and whatnot) and I can’t find anything.
Also, is this the right part of the forum to be posting this?
Rust’s ABI is undefined and unstable. The only place it is documented is in the compiler implementation, and in the heads of the people who work on it.
There is a lot of documentation in the compiler source code. For high level stuff, look for doc.rs in various directories, as well as big comments at the top of files.
Note that this may change anytime and might already have changed:
The function call ABI puts all structures bigger than a pointer behind a reference, same goes for RVO which triggers for everything bigger than a pointer. Struct layout currently is the same as C’s, for enums it’s a tagged union with an integer at the beginning that is big enough to cover all the variants (most of the time it’s a u8).
No, we don’t, we have our own “larger than a pointer” rule, and sadly there’s a lot of trans code that assumes that threshold so you can’t just change it to see if you get a perf increase or something.