-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
The feature gate for the issue is #![feature(c_variadic_naked_functions)].
This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions.
#![feature(c_variadic, c_variadic_naked_functions)]
#[unsafe(naked)]
unsafe extern "win64" fn variadic_win64(_: u32, _: ...) -> u32 {
core::arch::naked_asm!(
r#"
push rax
mov qword ptr [rsp + 40], r9
mov qword ptr [rsp + 24], rdx
mov qword ptr [rsp + 32], r8
lea rax, [rsp + 40]
mov qword ptr [rsp], rax
lea eax, [rdx + rcx]
add eax, r8d
pop rcx
ret
"#,
)
}About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Implement the feature implement
feature(c_variadic_naked_functions)#148770 - Adjust documentation (see instructions on rustc-dev-guide)
- Style updates for any new syntax (nightly-style-procedure)
- Style team decision on new formatting
- Formatting for new syntax has been added to the Style Guide
- (non-blocking) Formatting has been implemented in
rustfmt
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
XXX --- list all the "unresolved questions" found in the RFC to ensure they are
not forgotten