Skip to content

Tracking Issue for raw array getters (array_ptr_get) #119834

Open
@yotamofek

Description

@yotamofek

Feature gate: #![feature(array_ptr_get)]

This is a tracking issue for as_(mut_)ptr and as_(mut_)slice methods on raw array pointers, i.e. *(const/mut) [T; N].

See also:

Public API

impl<T, const N: usize> *mut [T; N] {
    pub fn as_mut_ptr(self) -> *mut T {}
    pub fn as_mut_slice(self) -> *mut [T] {}
}

impl<T, const N: usize> *const [T; N] {
    pub const fn as_ptr(self) -> *const T {}
    pub const fn as_slice(self) -> *const [T] {}
}

Steps / History

Unresolved Questions

  • If arbitrary_self_types (Arbitrary self types v2 rfcs#3519) is accepted, these methods may be changed to have a *(const/mut) Self receiver. Also, if a deref-like coercion mechanism is added (specifically, *[T; N] -> *[T], similar to the non-raw counterparts), these methods might become redundant.

Footnotes

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

Metadata

Metadata

Assignees

No one assigned

    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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions