Skip to content

Tracking Issue for slice_range #76393

Open

Description

The feature gate for the issue is #![feature(slice_range)].

This issue currently tracks the following API:

pub mod slice {
    pub fn range<R>(range: R, bounds: RangeTo<usize>) -> Range<usize>
    where
        R: RangeBounds<usize>;
}

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

  • Should this method be defined on RangeBounds or Range instead? (Move slice::check_range to RangeBounds #76885)
  • Should a non-panicking version be added?
  • Should this wait for #[final] methods in traits?
    • The main reason this isn't on RangeBounds is that today unsafe code can't trust any method on a not-unsafe trait to validate anything. But if this was a final method, and thus not overridable, then unsafe code could trust it.

Implementation history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-sliceArea: `[T]`C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.Libs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions