Skip to content

Allow arbitrary extern ABI #4086

@dtolnay

Description

@dtolnay

Rustfmt fails to format the following file, even though rustc happily compiles it.

I am using cfg here to repro, but the more important case in practice would be to allow non-standard ABI in the input of procedural macro attributes like https://github.com/dtolnay/cxx.

#[cfg(any())]
extern "C++" {}
error[E0703]: invalid ABI: found `C++`
 --> /git/testing/src/main.rs:2:8
  |
2 | extern "C++" {}
  |        ^^^^^ invalid ABI
  |
  = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions