Skip to content

Tracking Issue for ptr_const_cast #92675

Closed
@Kixunil

Description

@Kixunil

Feature gate: #![feature(ptr_const_cast)]

This is a tracking issue for methods on pointers for casting constness without changing the type

Public API

impl<T: ?Sized> *const T {
    pub fn as_mut(self) -> *mut T;
}

impl<T: ?Sized> *mut T {
    pub fn as_const(self) -> *const T;
}

Steps / History

Unresolved Questions

  • *mut T also already has as_mut() which does something different and has a different signature, adding a mehod of the same name to *const T could be confusing, so maybe a better name should be used. cast_const/cast_mut was suggested. Resolved to use cast_*

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.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions