1
Fork 0

Fix off-by-one error when specifying a valid range

This commit is contained in:
Dylan MacKenzie 2018-06-05 13:17:24 -07:00 committed by Ralf Jung
parent 6f7338bb92
commit 30122e91d9
2 changed files with 7 additions and 7 deletions

View file

@ -980,11 +980,11 @@ extern "rust-intrinsic" {
/// ///
/// * Both `src` and `dst` must be properly aligned. /// * Both `src` and `dst` must be properly aligned.
/// ///
/// * `src.offset(count)` must be [valid]. In other words, the region of /// * `src.offset(count-1)` must be [valid]. In other words, the region of
/// memory which begins at `src` and has a length of `count * /// memory which begins at `src` and has a length of `count *
/// size_of::<T>()` bytes must belong to a single, live allocation. /// size_of::<T>()` bytes must belong to a single, live allocation.
/// ///
/// * `dst.offset(count)` must be [valid]. In other words, the region of /// * `dst.offset(count-1)` must be [valid]. In other words, the region of
/// memory which begins at `dst` and has a length of `count * /// memory which begins at `dst` and has a length of `count *
/// size_of::<T>()` bytes must belong to a single, live allocation. /// size_of::<T>()` bytes must belong to a single, live allocation.
/// ///
@ -1068,11 +1068,11 @@ extern "rust-intrinsic" {
/// ///
/// * Both `src` and `dst` must be properly aligned. /// * Both `src` and `dst` must be properly aligned.
/// ///
/// * `src.offset(count)` must be [valid]. In other words, the region of /// * `src.offset(count-1)` must be [valid]. In other words, the region of
/// memory which begins at `src` and has a length of `count * /// memory which begins at `src` and has a length of `count *
/// size_of::<T>()` bytes must belong to a single, live allocation. /// size_of::<T>()` bytes must belong to a single, live allocation.
/// ///
/// * `dst.offset(count)` must be [valid]. In other words, the region of /// * `dst.offset(count-1)` must be [valid]. In other words, the region of
/// memory which begins at `dst` and has a length of `count * /// memory which begins at `dst` and has a length of `count *
/// size_of::<T>()` bytes must belong to a single, live allocation. /// size_of::<T>()` bytes must belong to a single, live allocation.
/// ///
@ -1118,7 +1118,7 @@ extern "rust-intrinsic" {
/// ///
/// * `dst` must be [valid]. /// * `dst` must be [valid].
/// ///
/// * `dst.offset(count)` must be [valid]. In other words, the region of /// * `dst.offset(count-1)` must be [valid]. In other words, the region of
/// memory which begins at `dst` and has a length of `count * /// memory which begins at `dst` and has a length of `count *
/// size_of::<T>()` bytes must belong to a single, live allocation. /// size_of::<T>()` bytes must belong to a single, live allocation.
/// ///

View file

@ -237,11 +237,11 @@ pub unsafe fn swap<T>(x: *mut T, y: *mut T) {
/// ///
/// * Both `x` and `y` must be properly aligned. /// * Both `x` and `y` must be properly aligned.
/// ///
/// * `x.offset(count)` must be [valid]. In other words, the region of memory /// * `x.offset(count-1)` must be [valid]. In other words, the region of memory
/// which begins at `x` and has a length of `count * size_of::<T>()` bytes /// which begins at `x` and has a length of `count * size_of::<T>()` bytes
/// must belong to a single, live allocation. /// must belong to a single, live allocation.
/// ///
/// * `y.offset(count)` must be [valid]. In other words, the region of memory /// * `y.offset(count-1)` must be [valid]. In other words, the region of memory
/// which begins at `y` and has a length of `count * size_of::<T>()` bytes /// which begins at `y` and has a length of `count * size_of::<T>()` bytes
/// must belong to a single, live allocation. /// must belong to a single, live allocation.
/// ///