From 5344b07addf342334470778964d863d99eec7430 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 24 Feb 2018 16:50:44 +0100 Subject: [PATCH] Add new warning for CStr::from_ptr --- src/libstd/ffi/c_str.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 2519d83043553..c88c2bc913713 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