Skip to content

feat(data_structures): add as_mut_slice method to IterMut via SliceIterMutExt trait#13437

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait
Aug 31, 2025
Merged

feat(data_structures): add as_mut_slice method to IterMut via SliceIterMutExt trait#13437
graphite-app[bot] merged 1 commit intomainfrom
08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 30, 2025

Add a new extension trait for mutable slice iterators, SliceIterMutExt.

This trait provides an as_mut_slice method for slice::IterMut, which exists in std library, but requires nightly Rust.

Copy link
Member Author

overlookmotel commented Aug 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 30, 2025

CodSpeed Instrumentation Performance Report

Merging #13437 will not alter performance

Comparing 08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait (d0479e9) with main (5b139aa)1

Summary

✅ 37 untouched benchmarks

Footnotes

  1. No successful run was found on main (d0479e9) during the generation of this report, so 5b139aa was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel changed the base branch from 08-30-feat_data_structures_add_ptr_and_end_ptr_methods_to_sliceiterext_ to graphite-base/13437 August 30, 2025 17:31
@overlookmotel overlookmotel force-pushed the 08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait branch from 6347cd3 to 8c391ee Compare August 30, 2025 17:31
@overlookmotel overlookmotel changed the base branch from graphite-base/13437 to 08-30-feat_data_structures_add_ptr_and_end_ptr_methods_to_sliceiterext_ August 30, 2025 17:31
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Aug 30, 2025
Copy link
Member Author

overlookmotel commented Aug 30, 2025

Merge activity

  • Aug 30, 10:12 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 30, 10:33 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Aug 30, 11:08 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #13435.
  • Aug 31, 12:26 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 31, 12:31 AM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Aug 31, 12:37 AM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Aug 31, 12:46 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 31, 12:51 AM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Aug 31, 12:51 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 08-30-feat_data_structures_add_ptr_and_end_ptr_methods_to_sliceiterext_ branch from 1f06e4c to 26adf36 Compare August 30, 2025 22:33
graphite-app bot pushed a commit that referenced this pull request Aug 30, 2025
…iceIterMutExt` trait (#13437)

Add a new extension trait for mutable slice iterators, `SliceIterMutExt`.

This trait provides an `as_mut_slice` method for `slice::IterMut`, which [exists in std library](https://doc.rust-lang.org/std/slice/struct.IterMut.html#method.as_mut_slice), but requires nightly Rust.
@graphite-app graphite-app bot force-pushed the 08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait branch from 8c391ee to 02e8ba3 Compare August 30, 2025 22:34
graphite-app bot pushed a commit that referenced this pull request Aug 30, 2025
…uction (#13438)

Use `as_mut_slice` method (introduced in #13437) to optimize `advance_unchecked` method on `slice::IterMut`. Previously it had a branch, now it's only 1 instruction.
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 30, 2025
@overlookmotel overlookmotel force-pushed the 08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait branch from 02e8ba3 to 6e4eb47 Compare August 31, 2025 00:25
@overlookmotel overlookmotel force-pushed the 08-30-feat_data_structures_add_ptr_and_end_ptr_methods_to_sliceiterext_ branch from 26adf36 to 165de00 Compare August 31, 2025 00:25
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Aug 31, 2025
@graphite-app graphite-app bot changed the base branch from 08-30-feat_data_structures_add_ptr_and_end_ptr_methods_to_sliceiterext_ to graphite-base/13437 August 31, 2025 00:31
@graphite-app graphite-app bot changed the base branch from graphite-base/13437 to main August 31, 2025 00:36
@github-actions github-actions bot added the A-codegen Area - Code Generation label Aug 31, 2025
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 31, 2025
…iceIterMutExt` trait (#13437)

Add a new extension trait for mutable slice iterators, `SliceIterMutExt`.

This trait provides an `as_mut_slice` method for `slice::IterMut`, which [exists in std library](https://doc.rust-lang.org/std/slice/struct.IterMut.html#method.as_mut_slice), but requires nightly Rust.
@overlookmotel overlookmotel force-pushed the 08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait branch from 6e4eb47 to d0479e9 Compare August 31, 2025 00:46
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Aug 31, 2025
@graphite-app graphite-app bot merged commit d0479e9 into main Aug 31, 2025
25 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 31, 2025
@graphite-app graphite-app bot deleted the 08-30-feat_data_structures_add_as_mut_slice_method_to_itermut_via_sliceitermutext_trait branch August 31, 2025 00:51
graphite-app bot pushed a commit that referenced this pull request Aug 31, 2025
…uction (#13438)

Use `as_mut_slice` method (introduced in #13437) to optimize `advance_unchecked` method on `slice::IterMut`. Previously it had a branch, now it's only 1 instruction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants