Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for const Iterator impls and related const fns #92476

Open
1 of 3 tasks
fee1-dead opened this issue Jan 1, 2022 · 6 comments
Open
1 of 3 tasks

Tracking Issue for const Iterator impls and related const fns #92476

fee1-dead opened this issue Jan 1, 2022 · 6 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-const_trait_impl `#![feature(const_trait_impl)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@fee1-dead
Copy link
Member

fee1-dead commented Jan 1, 2022

Feature gate: #![feature(const_iter)]

This is a tracking issue for const Iterator impls and related const fns.

Public API

// core::iter
impl<I: ~const Iterator + ?Sized> const Iterator for &mut I;
impl<I: Iterator> const IntoIterator for I;
impl<B, I: ~const Iterator, F> const Iterator for Map<I, F>
where
    F: ~const FnMut(I::Item) -> B + ~const Drop;

// core::option
impl<T> Option<T> {
    pub const fn iter_mut(&mut self) -> IterMut<'_, T>;
}

impl<T> const IntoIterator for Option<T>;
impl<'a, T> const IntoIterator for &'a Option<T>;
impl<'a, T> const IntoIterator for &'a mut Option<T>;
impl<'a, A> const Iterator for Iter<'a, A>;
impl<'a, A> const Iterator for IterMut<'a, A>;
impl<A> const Iterator for IntoIter<A>;

Steps / History

Unresolved Questions

  • None yet.
@fee1-dead fee1-dead added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Jan 1, 2022
@Expyron
Copy link
Contributor

Expyron commented Jan 5, 2022

Does this issue also track const implementations of slice and str iterators and their related functions or would that be a separate tracking issue?

For example:

  • core::slice::Iter and slice.iter()
  • core::str::Chars and str.chars()

@fee1-dead
Copy link
Member Author

fee1-dead commented Jan 5, 2022

@Expyron: those implementations have not been added yet. My plan is to land the smallest possible PR that simply makes it possible to work, and constify others in much smaller, finer grained PRs. Further work should use this tracking issue if related.

@TiagoCavalcante
Copy link

Any updates on this?

@fee1-dead
Copy link
Member Author

@TiagoCavalcante: implementation has been stalled for more compiler related work to make this as easy to maintain as possible.

@ImUrX
Copy link

ImUrX commented Dec 2, 2022

@fee1-dead could you update the linked PR to the new one?

@rinarakaki
Copy link

Is this affected by #110393?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-const_trait_impl `#![feature(const_trait_impl)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants