-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Extern/native function reform #3678
Comments
correct handling of moves for struct-record update. Part of rust-lang#3678. Fixes rust-lang#2828, rust-lang#3904, rust-lang#4719.
There have been more recent discussions on this topic: https://mail.mozilla.org/pipermail/rust-dev/2013-January/003013.html |
Completing the crust function change likely requires implementing #4479 - when making the foreign call we need to set up the stack pointer correctly so that, when foreign code calls the crust function, it can resume calculating stack boundaries correctly. |
Some notes on the plan of attack:
|
I believe this patch incorporates all expected syntax changes from extern function reform (rust-lang#3678). You can now write things like: extern "<abi>" fn foo(s: S) -> T { ... } extern "<abi>" mod { ... } extern "<abi>" fn(S) -> T The ABI for foreign functions is taken from this syntax (rather than from an annotation). We support the full ABI specification I described on the mailing list. The correct ABI is chosen based on the target architecture. Calls by pointer to C functions are not yet supported, and the Rust type of crust fns is still *u8.
Any word on this? It is very important for getting us some great OpenGL bindings. |
Echoing @bjz's question. I don't even see this in the bors queue anymore. |
visiting for triage. apparently any day now. Properly classified, nominating for back-compat or possibly well-defined. Though I imagine it'll land before we've got it accepted/rejected. |
accepted for backwards-compatible milestone |
…ons directly" This reverts commit 303f650.
It appears that this isn't complete yet: linking to foreign functions with a "Rust" or "RustCall" ABI is not implemented. See here. |
Per some meeting or other, we discussed a plan to reform how how C functions work. I have been laying some of the groundwork for this but I think there is no meta-bug discussing it and bringing together the various things that need to be done.
The plan is:
extern "abi" fn(S) -> T
whereabi
is one of the Rust-supported ABIs, and defaults toC
. (Addextern "abi" fn
type to represent C pointers #3321)extern fn
type (Remove bare function types, replace with inference #3320) andextern fn
(crust fn) declarationsextern fn
type; in trans, we generate a wrapper at that timeextern fn
type, we will generate inline the C-abi style invocation, perhaps generating wrappersThe text was updated successfully, but these errors were encountered: