Skip to content

Tracking Issue for slice_shift (shift_left/shift_right) #151772

@scottmcm

Description

@scottmcm

Feature gate: #![feature(slice_shift)]

This is a tracking issue for the [T]::shift_left and [T]::shift_right methods, which are the safe versions of memmove.

Public API

// in core
impl<T> [T] {
    pub fn shift_left<const N: usize>(&mut self, inserted: [T; N]) -> [T; N];
    pub fn shift_right<const N: usize>(&mut self, inserted: [T; N]) -> [T; N];
}

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • "Our conclusion from the meeting was: if it's possible to do this without appreciable runtime performance impact, we'd love to avoid a panic. If doing this would add runtime performance impact, we're happy to ship the panicking version." ~ Add [_]::shift_{left,right} libs-team#717 (comment)

Footnotes

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

Metadata

Metadata

Assignees

Labels

C-tracking-issueCategory: 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.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions