-
Notifications
You must be signed in to change notification settings - Fork 14k
implement feature(c_variadic_naked_functions)
#148770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+284
−80
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
|
|
7 tasks
Member
Member
|
seems fine. @bors r+ rollup |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 11, 2025
…kingjubilee implement `feature(c_variadic_naked_functions)` tracking issue: rust-lang#148767 [#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886) This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions. ```rust #![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 "#, ) } ``` r? `@workingjubilee`
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 11, 2025
…kingjubilee implement `feature(c_variadic_naked_functions)` tracking issue: rust-lang#148767 [#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886) This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions. ```rust #![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 "#, ) } ``` r? ``@workingjubilee``
bors
added a commit
that referenced
this pull request
Nov 12, 2025
Rollup of 12 pull requests Successful merges: - #146627 (Simplify `jemalloc` setup) - #147753 (Suggest add bounding value for RangeTo) - #147974 (Improve diagnostics for buffer reuse with borrowed references) - #148080 ([rustdoc] Fix invalid jump to def macro link generation) - #148424 (bootstrap: Add snapshot tests for path-to-step handling) - #148500 (Update git index before running diff-index) - #148536 (cmse: add test for `async` and `const` functions) - #148770 (implement `feature(c_variadic_naked_functions)`) - #148819 (Remove specialized warning for removed target) - #148830 (miri subtree update) - #148833 (Update rustbook dependencies) - #148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 12, 2025
…kingjubilee implement `feature(c_variadic_naked_functions)` tracking issue: rust-lang#148767 [#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886) This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions. ```rust #![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 "#, ) } ``` r? ```@workingjubilee```
bors
added a commit
that referenced
this pull request
Nov 12, 2025
Rollup of 16 pull requests Successful merges: - #146627 (Simplify `jemalloc` setup) - #147753 (Suggest add bounding value for RangeTo) - #147832 (rustdoc: Don't pass `RenderOptions` to `DocContext`) - #147974 (Improve diagnostics for buffer reuse with borrowed references) - #148080 ([rustdoc] Fix invalid jump to def macro link generation) - #148465 (Adjust spans into the `for` loops context before creating the new desugaring spans.) - #148500 (Update git index before running diff-index) - #148531 (rustc_target: introduce Abi, Env, Os) - #148536 (cmse: add test for `async` and `const` functions) - #148770 (implement `feature(c_variadic_naked_functions)`) - #148780 (fix filecheck typos in tests) - #148819 (Remove specialized warning for removed target) - #148830 (miri subtree update) - #148833 (Update rustbook dependencies) - #148834 (fix(rustdoc): Color doctest errors) - #148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Nov 12, 2025
Rollup merge of #148770 - folkertdev:naked-c-variadic, r=workingjubilee implement `feature(c_variadic_naked_functions)` tracking issue: #148767 [#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886) This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions. ```rust #![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 "#, ) } ``` r? ````@workingjubilee````
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Nov 12, 2025
Rollup of 16 pull requests Successful merges: - rust-lang/rust#146627 (Simplify `jemalloc` setup) - rust-lang/rust#147753 (Suggest add bounding value for RangeTo) - rust-lang/rust#147832 (rustdoc: Don't pass `RenderOptions` to `DocContext`) - rust-lang/rust#147974 (Improve diagnostics for buffer reuse with borrowed references) - rust-lang/rust#148080 ([rustdoc] Fix invalid jump to def macro link generation) - rust-lang/rust#148465 (Adjust spans into the `for` loops context before creating the new desugaring spans.) - rust-lang/rust#148500 (Update git index before running diff-index) - rust-lang/rust#148531 (rustc_target: introduce Abi, Env, Os) - rust-lang/rust#148536 (cmse: add test for `async` and `const` functions) - rust-lang/rust#148770 (implement `feature(c_variadic_naked_functions)`) - rust-lang/rust#148780 (fix filecheck typos in tests) - rust-lang/rust#148819 (Remove specialized warning for removed target) - rust-lang/rust#148830 (miri subtree update) - rust-lang/rust#148833 (Update rustbook dependencies) - rust-lang/rust#148834 (fix(rustdoc): Color doctest errors) - rust-lang/rust#148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-naked
Area: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzS
F-c_variadic
`#![feature(c_variadic)]`
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

tracking issue: #148767
#t-lang > C-variadic naked functions
This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions.
r? @workingjubilee