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
Closed

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

pnkfelix opened this issue Jul 18, 2016 · 4 comments
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

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 pnkfelix added T-lang Relevant to the language team, which will review and decide on the PR/issue. I-nominated labels Jul 18, 2016
@pnkfelix
Copy link
Member Author

cc @eddyb @nikomatsakis

@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
Copy link
Contributor

One more interesting example:

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

I'll fix this.

@nikomatsakis
Copy link
Contributor

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

@nikomatsakis
Copy link
Contributor

Discussed ABIs in context of the PR, denominating.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 30, 2016
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
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants