A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rust-lang/rust/issues/71146 below:

Tracking Issue for raw slice len() method (slice_ptr_len, const_slice_ptr_len) · Issue #71146 · rust-lang/rust · GitHub

This is a tracking issue for the len() method on raw slice pointers, which allows to get the length of a raw slice pointer when conversion to a slice reference would be UB (because the pointer is null or unaligned).

It covers the feature gates #![feature(slice_ptr_len)] and #![feature(const_slice_ptr_len)] (for const fn).

Public API
impl<T> *mut [T] {
    pub const fn len(self) -> usize;
    pub const fn is_empty(self) -> bool;
}

impl<T> *const [T] {
    pub const fn len(self) -> usize;
    pub const fn is_empty(self) -> bool;
}

impl<T> NonNull<[T]> {
    pub const fn len(self) -> usize; // Already stable
    pub const fn is_empty(self) -> bool;
}
History / Steps Open questions

TianyiShi2001, mexus, ilyavennik, yvt, stepancheg and 2 morekornelskistanislav-tkach and mexus


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4