diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-12-08 01:43:10 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-12-13 11:27:02 +0100 |
| commit | 5e17e3988165d3245e38af0b1c40cde47699f6a7 (patch) | |
| tree | 306b98ec54bf16d1327e0264b51d356bdba02d9b /src/libstd/ffi | |
| parent | d75c7530f38b56c4d916195570cdcd18c12ce273 (diff) | |
| download | rust-5e17e3988165d3245e38af0b1c40cde47699f6a7.tar.gz rust-5e17e3988165d3245e38af0b1c40cde47699f6a7.zip | |
Require stable/unstable annotations for the constness of all stable functions with a `const` modifier
Diffstat (limited to 'src/libstd/ffi')
| -rw-r--r-- | src/libstd/ffi/c_str.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 6dcda986310..14ca0423d8b 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -1065,7 +1065,8 @@ impl CStr { /// ``` #[inline] #[stable(feature = "cstr_from_bytes", since = "1.10.0")] - #[rustc_const_unstable(feature = "const_cstr_unchecked")] + #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_cstr_unchecked"))] + #[cfg_attr(not(bootstrap), rustc_const_unstable(feature = "const_cstr_unchecked", issue = "0"))] pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { &*(bytes as *const [u8] as *const CStr) } @@ -1119,6 +1120,7 @@ impl CStr { /// [`CString`]: struct.CString.html #[inline] #[stable(feature = "rust1", since = "1.0.0")] + #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_str_as_ptr", since = "1.32.0"))] pub const fn as_ptr(&self) -> *const c_char { self.inner.as_ptr() } |
