Skip to content

perf: store splat arg index in a single byte#158251

Closed
teor2345 wants to merge 13 commits into
rust-lang:mainfrom
teor2345:fn-arg-splat-exp-255-limit
Closed

perf: store splat arg index in a single byte#158251
teor2345 wants to merge 13 commits into
rust-lang:mainfrom
teor2345:fn-arg-splat-exp-255-limit

Conversation

@teor2345

@teor2345 teor2345 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This is a perf test for a variation of #153697.
It's part of the splat lang experiment, tracking issue #153629.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Jun 22, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 22, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
perf: store splat arg index in a single byte
@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_type_ir/src/ty_kind.rs Outdated
@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_hir/src/hir.rs Outdated
@rust-bors

rust-bors Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 51cfa71 (51cfa71c5e3563738f2ed8b82f18684e522dbc8d)
Base parent: 9030e34 (9030e345fe92df1ccefd0a8cdf61a9a9a5b73cb0)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (51cfa71): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 5
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 5

Max RSS (memory usage)

Results (secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-3.3%, -1.7%] 6
All ❌✅ (primary) - - 0

Cycles

Results (secondary 4.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.9% [1.7%, 18.5%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 56
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 75
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 56

Bootstrap: 503.321s -> 509.023s (1.13%)
Artifact size: 353.40 MiB -> 353.69 MiB (0.08%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 22, 2026
@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 22, 2026
@teor2345

Copy link
Copy Markdown
Contributor Author

0.1% regression on 5 primary and 0.2% on 4 secondary benchmarks seems like as good as we'll get.

I'll replace #153697 with this branch once I've checked with Oli.

@teor2345

Copy link
Copy Markdown
Contributor Author

I'm going to push these perf fixes to #153697

@teor2345 teor2345 closed this Jun 23, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 23, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 25, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 25, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 25, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 25, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 25, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 26, 2026
…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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 26, 2026
…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
rust-timer added a commit that referenced this pull request Jun 27, 2026
Rollup merge of #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:
- #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](#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 #155223 - [0.3% perf improvement across 45 primary benchmarks](#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
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Jun 27, 2026
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/rust#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/rust#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/rust#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang/rust#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
pull Bot pushed a commit to Kokoro2336/rust-analyzer that referenced this pull request Jun 29, 2026
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/rust#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/rust#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/rust#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang/rust#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
@teor2345

teor2345 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot label +F-splat

@rustbot rustbot added the F-splat `#![feature(splat)]` label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-splat `#![feature(splat)]` perf-regression Performance regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants