-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Description
This is a tracking issue for a couple of basic methods on arrays. The feature gate for the issue is #![feature(array_methods)]
. Currently, this includes the following methods:
as_slice
,as_mut_slice
Add[T; N]::as_[mut_]slice
#76120each_ref
,each_mut
Add[T; N]::each_ref
and[T; N]::each_mut
#75490
Note: these methods were all collected under the same array_methods
feature name as I suspect many (often small) methods to be added to array in the near future. Creating a new feature and tracking issue for each seems overkill. We can still split off some methods into dedicated features later, if required.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses 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.
Steps
- Decide what set of methods to stabilize in the first roundChange feature names of all methods that are not yet stabilized to something specificAdjust documentation (see instructions on rustc-dev-guide)Stabilization PR (see instructions on rustc-dev-guide)To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Unresolved Questions
- Use the names
each_ref
andeach_mut
or change it to something else? Alternatives:each_as_ref
/each_as_mut
,as_refs
/as_mut_refs
. See PR Add[T; N]::each_ref
and[T; N]::each_mut
#75490 for the name discussion.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Activity
[T; N]::as_[mut_]slice
#76120[T; N]::each_ref
and[T; N]::each_mut
#75490LukasKalbertodt commentedon Aug 30, 2020
Just for the protocol, I plan to add the following methods in the near future:
cloned
,copied
andunzip
: blocked by figuring out how we best add additional impl blocks for arrays (e.g.[&T; N] where T: Clone
)already added in Added [T; N]::zip() #79451zip
: waiting for addarray::FillError
similar toarray::IntoIter
#75717 or Add 'core::array::from_fn' and 'core::array::try_from_fn' #75644 to get merged; otherwise this method would add duplicate code(discussions about the usefulness of those method should be had in the dedicated PR threads and not here)
Rollup merge of rust-lang#76120 - LukasKalbertodt:add-as-slice-method…
SmallVec
tomin_const_generics
use-ink/ink#598usbalbin commentedon Nov 29, 2020
@LukasKalbertodt I have opened PR #79451 for
zip
, saw your comment just now.38 remaining items
pravic commentedon Oct 20, 2023
Any news about this?
rfcbot commentedon Jan 16, 2024
🔔 This is now entering its final comment period, as per the review above. 🔔
rfcbot commentedon Jan 26, 2024
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
This will be merged soon.
Rollup merge of rust-lang#103522 - Dylan-DPC:76118/array-methods-stab…
Rollup merge of rust-lang#103522 - Dylan-DPC:76118/array-methods-stab…
Unrolled build for rust-lang#103522
Less unsafe with array_methods