Skip to content
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

`rust-call` call ABI is not feature gated in all points of declaration #34900

Closed
pnkfelix opened this Issue Jul 18, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@pnkfelix
Copy link
Member

pnkfelix commented Jul 18, 2016

Test case playpen

fn foo() { println!("foo"); }

fn main() {
    let f: extern "rust-call" fn((), ());
    f = unsafe { std::mem::transmute(foo as fn()) };
    f((), ())
}
@pnkfelix

This comment has been minimized.

Copy link
Member Author

pnkfelix commented Jul 18, 2016

@pnkfelix pnkfelix changed the title `rust-call` call ABI is not feature gated in all places `rust-call` call ABI is not feature gated in all points of declaration Jul 18, 2016

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Jul 18, 2016

One more interesting example:

extern "rust-call" {
    // Foreign items
}

I'll fix this.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jul 18, 2016

D'oh. Does seem like we ought to feature-gate this. I don't envision a lot of trouble.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jul 28, 2016

Discussed ABIs in context of the PR, denominating.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 30, 2016

Rollup merge of rust-lang#34904 - petrochenkov:rustcall, r=nikomatsakis
Properly feature gate all unstable ABIs

Fixes rust-lang#34900
[breaking-change]
r? @pnkfelix

---
Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind rust-lang#34900. I'll try to restructure these visitors a bit and send one more PR later.

bors added a commit that referenced this issue Jul 30, 2016

Auto merge of #34904 - petrochenkov:rustcall, r=nikomatsakis
Properly feature gate all unstable ABIs

Fixes #34900
[breaking-change]
r? @pnkfelix

---
Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind #34900. I'll try to restructure these visitors a bit and send one more PR later.

@bors bors closed this in #34904 Jul 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.