-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Feature-gate non-Rust ABI methods #30235
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Comments
+1 for feature gating, but I think it probably does need an RFC |
Didn't we write an RFC about this already? I have some vague memory of this. |
(When I first read this, it seemed absurdly broad, but then I saw another interpretation, so here's my Q...) @Aatch just to be clear, you're just talking about methods (as in, "stuff in impl blocks") and not free-fn's, right? I.e. we would not be feature-gating extern fn printf(fmt: *const u8); but we would be feature-gating: impl Print { extern fn printf(fmt: *const u8); } Right? |
bors
added a commit
that referenced
this issue
Mar 18, 2016
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
bors
added a commit
that referenced
this issue
Mar 18, 2016
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
bors
added a commit
that referenced
this issue
Mar 18, 2016
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Currently we allow methods to be marked with the
extern
qualifier indicating that they have a non-Rust ABI (default is "C"). They are rather bug-ridden, only really working by accident, see #26997 and #26049.While I personally think they shouldn't be allowed to start with, putting them behind a feature-gate until we make a decision either way seems like a good idea.
Hopefully this doesn't require an RFC, but if it does, I'll write one up and this can be a tracking issue.
/cc @rust-lang/lang
The text was updated successfully, but these errors were encountered: