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 vec_deque_iter_as_slices #133253

Open
1 of 3 tasks
zopsicle opened this issue Nov 20, 2024 · 4 comments
Open
1 of 3 tasks

Tracking Issue for vec_deque_iter_as_slices #133253

zopsicle opened this issue Nov 20, 2024 · 4 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@zopsicle
Copy link
Contributor

Feature gate: #![feature(vec_deque_iter_as_slices)]

This is a tracking issue for:

  • alloc::collections::vec_deque::Iter::as_slices
  • alloc::collections::vec_deque::IterMut::into_slices
  • alloc::collections::vec_deque::IterMut::as_slices
  • alloc::collections::vec_deque::IterMut::as_mut_slices

Each of these functions obtains a pair of slices from a VecDeque iterator, similar to VecDeque::as_slices.

Public API

use std::collections::vec_deque::{Iter, IterMut};

impl<'a, T> Iter<'a, T> {
    pub fn as_slices(&self) -> (&'a [T], &'a [T]) { ... }
}

impl<'a, T> IterMut<'a, T> {
    pub fn into_slices(self) -> (&'a mut [T], &'a mut [T]) { ... }
    pub fn as_slices(&self) -> (&[T], &[T]) { ... }
    pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) { ... }
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@zopsicle zopsicle added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Nov 20, 2024
@recatek
Copy link

recatek commented Mar 13, 2025

Hello! Are there any outstanding questions or obstacles to stabilizing this? I would find it very useful to have!

@zopsicle
Copy link
Contributor Author

Not as far as I am concerned. :)

@recatek
Copy link

recatek commented Mar 13, 2025

I did notice one thing which is that this uses slice::IterMut::as_mut_slice() which itself appears to be unstable. #93079

Am I reading that correctly? If so, perhaps the as_mut_slices function here should be marked as unstable under slice_iter_mut_as_mut_slice as well?

@zopsicle
Copy link
Contributor Author

Plenty of stable features are implemented using unstable features. That shouldn’t be a blocker.

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 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

2 participants