Skip to content

Platform-specific function ABIs are not validated #81396

Closed
@jonas-schievink

Description

@jonas-schievink

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions