提交 9d6bd053 编写于 作者: T Trevor Spiteri

docs: do not call integer overflows as underflows

上级 7eb64b86
......@@ -114,7 +114,7 @@ fn full_div_rem(self, other: $ty, borrow: $ty) -> ($ty, $ty) {
/// copying it recklessly may result in the performance hit.
/// Thus this is intentionally not `Copy`.
///
/// All operations available to bignums panic in the case of over/underflows.
/// All operations available to bignums panic in the case of overflows.
/// The caller is responsible to use large enough bignum types.
pub struct $name {
/// One plus the offset to the maximum "digit" in use.
......
......@@ -402,7 +402,7 @@ pub fn checked_add(self, rhs: Self) -> Option<Self> {
}
/// Checked integer subtraction. Computes `self - rhs`, returning
/// `None` if underflow occurred.
/// `None` if overflow occurred.
///
/// # Examples
///
......@@ -420,7 +420,7 @@ pub fn checked_sub(self, rhs: Self) -> Option<Self> {
}
/// Checked integer multiplication. Computes `self * rhs`, returning
/// `None` if underflow or overflow occurred.
/// `None` if overflow occurred.
///
/// # Examples
///
......@@ -438,7 +438,7 @@ pub fn checked_mul(self, rhs: Self) -> Option<Self> {
}
/// Checked integer division. Computes `self / rhs`, returning `None`
/// if `rhs == 0` or the operation results in underflow or overflow.
/// if `rhs == 0` or the operation results in overflow.
///
/// # Examples
///
......@@ -460,7 +460,7 @@ pub fn checked_div(self, rhs: Self) -> Option<Self> {
}
/// Checked integer remainder. Computes `self % rhs`, returning `None`
/// if `rhs == 0` or the operation results in underflow or overflow.
/// if `rhs == 0` or the operation results in overflow.
///
/// # Examples
///
......@@ -1598,7 +1598,7 @@ pub fn checked_add(self, rhs: Self) -> Option<Self> {
}
/// Checked integer subtraction. Computes `self - rhs`, returning
/// `None` if underflow occurred.
/// `None` if overflow occurred.
///
/// # Examples
///
......@@ -1616,7 +1616,7 @@ pub fn checked_sub(self, rhs: Self) -> Option<Self> {
}
/// Checked integer multiplication. Computes `self * rhs`, returning
/// `None` if underflow or overflow occurred.
/// `None` if overflow occurred.
///
/// # Examples
///
......@@ -1634,7 +1634,7 @@ pub fn checked_mul(self, rhs: Self) -> Option<Self> {
}
/// Checked integer division. Computes `self / rhs`, returning `None`
/// if `rhs == 0` or the operation results in underflow or overflow.
/// if `rhs == 0` or the operation results in overflow.
///
/// # Examples
///
......@@ -1654,7 +1654,7 @@ pub fn checked_div(self, rhs: Self) -> Option<Self> {
}
/// Checked integer remainder. Computes `self % rhs`, returning `None`
/// if `rhs == 0` or the operation results in underflow or overflow.
/// if `rhs == 0` or the operation results in overflow.
///
/// # Examples
///
......
......@@ -581,8 +581,7 @@ pub unsafe fn as_ref<'a>(self) -> Option<&'a T> {
/// * Both the starting and resulting pointer must be either in bounds or one
/// byte past the end of an allocated object.
///
/// * The computed offset, **in bytes**, cannot overflow or underflow an
/// `isize`.
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
///
/// * The offset being in bounds cannot rely on "wrapping around" the address
/// space. That is, the infinite-precision sum, **in bytes** must fit in a usize.
......@@ -714,8 +713,7 @@ pub fn offset_to(self, other: *const T) -> Option<isize> where T: Sized {
/// * Both the starting and resulting pointer must be either in bounds or one
/// byte past the end of an allocated object.
///
/// * The computed offset, **in bytes**, cannot overflow or underflow an
/// `isize`.
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
///
/// * The offset being in bounds cannot rely on "wrapping around" the address
/// space. That is, the infinite-precision sum must fit in a `usize`.
......@@ -1219,8 +1217,7 @@ pub unsafe fn as_ref<'a>(self) -> Option<&'a T> {
/// * Both the starting and resulting pointer must be either in bounds or one
/// byte past the end of an allocated object.
///
/// * The computed offset, **in bytes**, cannot overflow or underflow an
/// `isize`.
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
///
/// * The offset being in bounds cannot rely on "wrapping around" the address
/// space. That is, the infinite-precision sum, **in bytes** must fit in a usize.
......@@ -1419,8 +1416,7 @@ pub fn align_offset(self, align: usize) -> usize {
/// * Both the starting and resulting pointer must be either in bounds or one
/// byte past the end of an allocated object.
///
/// * The computed offset, **in bytes**, cannot overflow or underflow an
/// `isize`.
/// * The computed offset, **in bytes**, cannot overflow an `isize`.
///
/// * The offset being in bounds cannot rely on "wrapping around" the address
/// space. That is, the infinite-precision sum must fit in a `usize`.
......
......@@ -263,7 +263,7 @@ impl<R: Seek> Seek for BufReader<R> {
/// See `std::io::Seek` for more details.
///
/// Note: In the edge case where you're seeking with `SeekFrom::Current(n)`
/// where `n` minus the internal buffer length underflows an `i64`, two
/// where `n` minus the internal buffer length overflows an `i64`, two
/// seeks will be performed instead of one. If the second seek returns
/// `Err`, the underlying reader will be left at the same position it would
/// have if you seeked to `SeekFrom::Current(0)`.
......
......@@ -290,7 +290,7 @@ pub fn checked_add(self, rhs: Duration) -> Option<Duration> {
}
/// Checked `Duration` subtraction. Computes `self - other`, returning [`None`]
/// if the result would be negative or if underflow occurred.
/// if the result would be negative or if overflow occurred.
///
/// [`None`]: ../../std/option/enum.Option.html#variant.None
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册