-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(const_intoiterator_identity)]
This is a tracking issue for the const IntoIterator
implementation for types that are already iterators.
This is not a new api; only constifying an existing one
Public API
// core::iter
// actually core/iter/traits/collect.rs, but re-exported from there.
impl<I: ~const Iterator> const IntoIterator for I {
type Item = I::Item;
type IntoIter = I;
fn into_iter(self) -> I;
}
Steps / History
- Implementation: Unstably constify
impl<I: Iterator> IntoIterator for I
#90602Final comment period (FCP)Stabilization PRTo 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
- Should it bound on the resultant
Iterator
being aconst Iterator
or not? I've gone with having the bound for now. Note: This can be relaxed later without breaking any code.
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
impl<I: Iterator> IntoIterator for I
#90602const
impl
s forIterator
#92433Auto merge of rust-lang#90602 - mbartlett21:const-intoiterator, r=oli…
zakarumych commentedon Aug 8, 2022
Why would it have
I: ~const Iterator
bound instead ofI: Iterator
?mbartlett21 commentedon Aug 8, 2022
See #90602 (comment).
Basically, it makes it compatible with whether the IntoIterator trait gets a bound or not, and if it doesn't get a bound, this implementation can always be loosened later.
zakarumych commentedon Aug 9, 2022
Not sure I follow.
It's conservative and can be relaxed later - I get this part.
What is motivation to not relax it right away?
mbartlett21 commentedon Aug 9, 2022
It was a decision that could be changed later, so I just chose a choice and went with that. Either way, that's a question that can come up when the actual trait gets changed (or not) and const impls are stabilised.
The motivation is that there was also no motivation to go the other way either.
shahn commentedon Dec 26, 2024
I noticed that since a0215d8, there is is no remaining usage of
const_intoiterator_identity
. Should this issue be closed? CC @RalfJungRalfJung commentedon Dec 26, 2024
Yeah this feature was long removed, I just cleaned up some leftovers in that PR.