Skip to content

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

Closed
Aatch opened this issue Dec 6, 2015 · 4 comments · Fixed by #32080
Closed

Feature-gate non-Rust ABI methods #30235

Aatch opened this issue Dec 6, 2015 · 4 comments · Fixed by #32080
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@Aatch
Copy link
Contributor

Aatch commented Dec 6, 2015

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

@nrc
Copy link
Member

nrc commented Dec 6, 2015

+1 for feature gating, but I think it probably does need an RFC

@nikomatsakis
Copy link
Contributor

Didn't we write an RFC about this already? I have some vague memory of this.

@pnkfelix
Copy link
Member

(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?

@steveklabnik
Copy link
Member

@pnkfelix i had the same reaction, and then read closely and realized that yeah, I think @Aatch is talking about only methods.

@huonw huonw added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Jan 6, 2016
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
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants