-
Couldn't load subscription status.
- Fork 13.9k
Description
This is a tracking issue for the unsupported_calling_conventions lint. This lint warns against
- Using
extern "cdecl"on non-x86-32 targets. Useextern "C"instead, there is no difference in behavior. - Using
extern "stdcall"orextern "fastcall"on non-x86-32 Windows targets. These ABIs are only defined for x86-32.- If you want to use "stdcall on x86-32-windows, C everywhere else", then use
extern "system". - Otherwise, if you really need the same function both on x86-32 and on other targets but with a different ABI, consider using the
fn_abicrate. Also we'd be interested to hear about your use-case, so please leave a comment below.
- If you want to use "stdcall on x86-32-windows, C everywhere else", then use
Implementation history:
Timeline:
- This was introduced with Rust 1.89.
- There's no timeline yet for when this will show up in cargo's future-compat reports, or be turned into a hard error. Since windows-sys needs an update to v0.60 to avoid the lint, we'll have to move really slowly here.
Original issue description
We generally accept stdcall on non-x86-32 Windows targets (while rejecting it on other non-x86-32 targets). See the discussion about this at #86231 (comment) and #86231 (comment). However, @ChrisDenton points out that the raw-dylib feature is more strict here. That's an inconsistency that we should probably fix?
@ChrisDenton can you give an example of what exactly is being rejected by raw-dylib here?
2025-05-05: See here for the current latest proposal.
Cc @workingjubilee @rust-lang/lang @nagisa @petrochenkov