Rollup merge of #47807 - tbu-:pr_doc_constanttime_cstr, r=steveklabnik

Make wording around 0-cost casts more precise
This commit is contained in:
kennytm
2018-02-06 02:13:50 +08:00
committed by GitHub

View File

@@ -1026,9 +1026,9 @@ impl CStr {
/// The returned slice will **not** contain the trailing nul terminator that this C /// The returned slice will **not** contain the trailing nul terminator that this C
/// string has. /// string has.
/// ///
/// > **Note**: This method is currently implemented as a 0-cost cast, but /// > **Note**: This method is currently implemented as a constant-time
/// > it is planned to alter its definition in the future to perform the /// > cast, but it is planned to alter its definition in the future to
/// > length calculation whenever this method is called. /// > perform the length calculation whenever this method is called.
/// ///
/// # Examples /// # Examples
/// ///
@@ -1077,9 +1077,9 @@ impl CStr {
/// it will return an error with details of where UTF-8 validation failed. /// it will return an error with details of where UTF-8 validation failed.
/// ///
/// > **Note**: This method is currently implemented to check for validity /// > **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 /// > after a constant-time cast, but it is planned to alter its definition
/// > future to perform the length calculation in addition to the UTF-8 /// > in the future to perform the length calculation in addition to the
/// > check whenever this method is called. /// > UTF-8 check whenever this method is called.
/// ///
/// [`&str`]: ../primitive.str.html /// [`&str`]: ../primitive.str.html
/// ///
@@ -1110,9 +1110,9 @@ impl CStr {
/// with the result. /// with the result.
/// ///
/// > **Note**: This method is currently implemented to check for validity /// > **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 /// > after a constant-time cast, but it is planned to alter its definition
/// > future to perform the length calculation in addition to the UTF-8 /// > in the future to perform the length calculation in addition to the
/// > check whenever this method is called. /// > UTF-8 check whenever this method is called.
/// ///
/// [`Cow`]: ../borrow/enum.Cow.html /// [`Cow`]: ../borrow/enum.Cow.html
/// [`Borrowed`]: ../borrow/enum.Cow.html#variant.Borrowed /// [`Borrowed`]: ../borrow/enum.Cow.html#variant.Borrowed