Skip to content

Tracking Issue for const_vec_string_slice #129041

Open
@GrigorenkoPV

Description

Feature gate: #![feature(const_vec_string_slice)]

This is a tracking issue for making a bunch of String and Vec methods const.

Public API

The following methods are now const:

impl String {
    pub const fn into_bytes(self) -> Vec<u8>
    pub const fn as_str(&self) -> &str
    pub const fn capacity(&self) -> usize
    pub const fn as_bytes(&self) -> &[u8]
    pub const fn len(&self) -> usize
    pub const fn is_empty(&self) -> bool
}

impl Vec<T> {
    pub const fn capacity(&self) -> usize
    pub const fn as_slice(&self) -> &[T]
    pub const fn as_ptr(&self) -> *const T
    pub const fn len(&self) -> usize
    pub const fn is_empty(&self) -> bool
}

Steps / History

Unresolved Questions

  • None yet.

@rustbot label A-str

Footnotes

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

Activity

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-strArea: str and StringC-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.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions