You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#153697 - teor2345:fn-arg-splat-experiment, r=oli-obk
Add arg splat experiment initial tuple impl
### Description
This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals:
- rust-lang#153629
- https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html
- https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html
Example code using existing unstable features:
- https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5
Discussion of implementation strategy:
- [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336)
The PR is the initial implementation of the feature:
- `splat` incomplete feature gate
- `#[splat]` attribute on function arguments
- Splatted function argument TypeInfo
- `#[splat]` function parameter check at THIR level
- splatted MIR lowering (as tupled arguments)
- feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example
- about half the diff (1100 lines) is tests and test output
Once this PR merges, we can add further functionality, then test it out in interop tools.
### Perf Impact
We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)).
We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment.
This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR.
### Out of Scope for this PR
- Change codegen to de-tuple caller and callee
- Better diagnostics
- Full support for splatted function pointer arguments
0 commit comments