-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-codegenArea: Code generationArea: Code generationA-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Description
Per some meeting or other, we discussed a plan to reform how how C functions work. I have been laying some of the groundwork for this but I think there is no meta-bug discussing it and bringing together the various things that need to be done.
The plan is:
- Add a type
extern "abi" fn(S) -> Twhereabiis one of the Rust-supported ABIs, and defaults toC. (Addextern "abi" fntype to represent C pointers #3321) - Remove the current
extern fntype (Remove bare function types, replace with inference #3320) andextern fn(crust fn) declarations- Allow bare fns to be inferred to
extern fntype; in trans, we generate a wrapper at that time
- Allow bare fns to be inferred to
- Remove the wrappers in trans that we currently use to adapt C functions to Rust ABI
- When calling a function of
extern fntype, we will generate inline the C-abi style invocation, perhaps generating wrappers
- When calling a function of
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-codegenArea: Code generationArea: Code generationA-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.