Skip to content

Tracking Issue for separate array length function #86403

Closed
@shamatar

Description

@shamatar

Feature gate: #![feature(array_len)]

This is a tracking issue for a separate length function on arrays (without coercing into slice and calling slice::len). It allows to lower array length access into constant in MIR without any additional modifications.

Public API

// core::array

impl<T, const N: usize> [T; N] {
    #[inline]
    pub const fn len(&self) -> usize {
        N
    }

Steps / History

Unresolved Questions

None so far

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library 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