From 9414c4ea18dab870bc0acbcd2be9a882aa17d68e Mon Sep 17 00:00:00 2001 From: arcnmx Date: Tue, 23 Feb 2016 01:36:50 -0500 Subject: [PATCH] Link cstr from_bytes to tracking issue --- src/libstd/ffi/c_str.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index e3c51a74b09..f3561622fa3 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -439,7 +439,7 @@ impl CStr { /// Creates a C string wrapper from a byte slice. /// /// This function will cast the provided `bytes` to a `CStr` wrapper after - /// ensuring that it is null terminated but does not contain any interior + /// ensuring that it is null terminated and does not contain any interior /// nul bytes. /// /// # Examples @@ -453,8 +453,8 @@ impl CStr { /// assert!(cstr.is_some()); /// # } /// ``` - #[unstable(feature = "cstr_from_bytes", reason = "recently added", issue = "0")] - pub fn from_bytes_with_nul<'a>(bytes: &'a [u8]) -> Option<&'a CStr> { + #[unstable(feature = "cstr_from_bytes", reason = "recently added", issue = "31190")] + pub fn from_bytes_with_nul(bytes: &[u8]) -> Option<&CStr> { if bytes.is_empty() || memchr::memchr(0, &bytes) != Some(bytes.len() - 1) { None } else { @@ -482,8 +482,8 @@ impl CStr { /// } /// # } /// ``` - #[unstable(feature = "cstr_from_bytes", reason = "recently added", issue = "0")] - pub unsafe fn from_bytes_with_nul_unchecked<'a>(bytes: &'a [u8]) -> &'a CStr { + #[unstable(feature = "cstr_from_bytes", reason = "recently added", issue = "31190")] + pub unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { mem::transmute(bytes) }