Align ArrayWindows trait impls with Windows
#151613
Open
+33
−1
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.
With
slice::ArrayWindowsgetting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared toslice::Windows, and I think we should align these.derive(Copy)-- we generally don't wantCopyfor iterators at all, as this is seen as a footgun (e.g. remove Copy impls from remaining iterators #21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiringT: Copy.impl Clone, simply to avoid requiringT: Clone.impl FusedIterator, because it is trivially so. Thesince = "1.94.0"assumes we'll backport this, otherwise we should change that to the "current" placeholder.impl TrustedLen, because we can trust our implementation.impl TrustedRandomAccess, because the required__iterator_get_uncheckedmethod is straightforward.r? libs-api
@rustbot label beta-nominated
(at least for the
Copyremoval, but we could be more selective about the rest).