about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-24 16:50:44 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-24 16:50:44 +0100
commit5344b07addf342334470778964d863d99eec7430 (patch)
tree9aca36ef90e0de3d1e641abe8bb71442a499c177 /src/libstd
parent6070d3e47e5e9f15575a3bd33583358b52bc6eda (diff)
downloadrust-5344b07addf342334470778964d863d99eec7430.tar.gz
rust-5344b07addf342334470778964d863d99eec7430.zip
Add new warning for CStr::from_ptr
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/c_str.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 2519d830435..c88c2bc9137 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -875,6 +875,8 @@ impl CStr {
     ///   `ptr`.
     /// * There is no guarantee that the memory pointed to by `ptr` contains a
     ///   valid nul terminator byte at the end of the string.
+    /// * It is not guaranteed that the memory pointed by `ptr` won't change
+    ///   before the `CStr` has been destroyed.
     ///
     /// > **Note**: This operation is intended to be a 0-cost cast but it is
     /// > currently implemented with an up-front calculation of the length of