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

Platform-specific function ABIs are not validated #81396

Closed
jonas-schievink opened this issue Jan 25, 2021 · 2 comments
Closed

Platform-specific function ABIs are not validated #81396

jonas-schievink opened this issue Jan 25, 2021 · 2 comments
Labels
A-FFI Area: Foreign function interface (FFI) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

This code builds (and runs) fine on stable Rust when targeting x86_64-unknown-linux-gnu:

extern "aapcs" fn f() {}

fn main() {
    f();
}

Other nonsensical ABIs are also accepted, including win64, avr-interrupt (with feature gate). I expected all of these to result in a compilation error, since they are unsupported on x86_64-unknown-linux-gnu.

@jonas-schievink jonas-schievink added A-FFI Area: Foreign function interface (FFI) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jan 25, 2021
@ghost
Copy link

ghost commented Jun 12, 2021

cc #57182 #86231

@nagisa
Copy link
Member

nagisa commented Jun 12, 2021

Duplicate of #57182

@nagisa nagisa marked this as a duplicate of #57182 Jun 12, 2021
@nagisa nagisa closed this as completed Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants