Rollup merge of #91855 - xfix:const_cstr_unchecked, r=dtolnay

Stabilize const_cstr_unchecked

Closes #90343

``@rustbot`` modify labels: +T-libs-api
This commit is contained in:
Matthias Krüger 2021-12-13 18:15:17 +01:00 committed by GitHub
commit ff214b745d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 3 deletions

View File

@ -6,7 +6,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(bool_to_option)]
#![feature(const_cstr_unchecked)]
#![feature(crate_visibility_modifier)]
#![feature(extern_types)]
#![feature(in_band_lifetimes)]

View File

@ -1259,7 +1259,7 @@ impl CStr {
#[inline]
#[must_use]
#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
#[rustc_const_unstable(feature = "const_cstr_unchecked", issue = "90343")]
#[rustc_const_stable(feature = "const_cstr_unchecked", since = "1.59.0")]
pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr {
// SAFETY: Casting to CStr is safe because its internal representation
// is a [u8] too (safe only inside std).

View File

@ -252,7 +252,6 @@
#![feature(char_internals)]
#![cfg_attr(not(bootstrap), feature(concat_bytes))]
#![feature(concat_idents)]
#![feature(const_cstr_unchecked)]
#![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)]
#![feature(const_fn_trait_bound)]