about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-02-06 02:13:50 +0800
committerGitHub <noreply@github.com>2018-02-06 02:13:50 +0800
commite8688b4a2421616aaf7cc94e2fa7c39dd6f15580 (patch)
tree97971b4b2739bc9a9f767d60429c39935506b02a
parentddc4284b716b31bfb56bfbd1221253787988eb8b (diff)
parent6c86da288a6b658a2adb2c3de5dced871dc6826b (diff)
downloadrust-e8688b4a2421616aaf7cc94e2fa7c39dd6f15580.tar.gz
rust-e8688b4a2421616aaf7cc94e2fa7c39dd6f15580.zip
Rollup merge of #47807 - tbu-:pr_doc_constanttime_cstr, r=steveklabnik
Make wording around 0-cost casts more precise
-rw-r--r--src/libstd/ffi/c_str.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index a19fe825f21..e91d3a32a50 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -1026,9 +1026,9 @@ impl CStr {
     /// The returned slice will **not** contain the trailing nul terminator that this C
     /// string has.
     ///
-    /// > **Note**: This method is currently implemented as a 0-cost cast, but
-    /// > it is planned to alter its definition in the future to perform the
-    /// > length calculation whenever this method is called.
+    /// > **Note**: This method is currently implemented as a constant-time
+    /// > cast, but it is planned to alter its definition in the future to
+    /// > perform the length calculation whenever this method is called.
     ///
     /// # Examples
     ///
@@ -1077,9 +1077,9 @@ impl CStr {
     /// it will return an error with details of where UTF-8 validation failed.
     ///
     /// > **Note**: This method is currently implemented to check for validity
-    /// > after a 0-cost cast, but it is planned to alter its definition in the
-    /// > future to perform the length calculation in addition to the UTF-8
-    /// > check whenever this method is called.
+    /// > after a constant-time cast, but it is planned to alter its definition
+    /// > in the future to perform the length calculation in addition to the
+    /// > UTF-8 check whenever this method is called.
     ///
     /// [`&str`]: ../primitive.str.html
     ///
@@ -1110,9 +1110,9 @@ impl CStr {
     /// with the result.
     ///
     /// > **Note**: This method is currently implemented to check for validity
-    /// > after a 0-cost cast, but it is planned to alter its definition in the
-    /// > future to perform the length calculation in addition to the UTF-8
-    /// > check whenever this method is called.
+    /// > after a constant-time cast, but it is planned to alter its definition
+    /// > in the future to perform the length calculation in addition to the
+    /// > UTF-8 check whenever this method is called.
     ///
     /// [`Cow`]: ../borrow/enum.Cow.html
     /// [`Borrowed`]: ../borrow/enum.Cow.html#variant.Borrowed