mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-29 16:13:40 +00:00
Rollup merge of #90344 - xfix:tracking-issue-const_cstr_unchecked, r=Mark-Simulacrum
Add tracking issue number to const_cstr_unchecked Also created a tracking issue, see #90343. I think it makes sense to stabilize this somewhat soon considering abuse of `transmute` to have this feature in constants, see https://crates.io/crates/cstr for an example. Code can be rewritten to use `mem::transmute` to work on stable.
This commit is contained in:
commit
623c3e144e
@ -1257,7 +1257,7 @@ impl CStr {
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
|
||||
#[rustc_const_unstable(feature = "const_cstr_unchecked", issue = "none")]
|
||||
#[rustc_const_unstable(feature = "const_cstr_unchecked", issue = "90343")]
|
||||
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).
|
||||
|
Loading…
Reference in New Issue
Block a user