Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9d6bd053
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d6bd053
编写于
12月 21, 2017
作者:
T
Trevor Spiteri
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: do not call integer overflows as underflows
上级
7eb64b86
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
19 deletion
+15
-19
src/libcore/num/bignum.rs
src/libcore/num/bignum.rs
+1
-1
src/libcore/num/mod.rs
src/libcore/num/mod.rs
+8
-8
src/libcore/ptr.rs
src/libcore/ptr.rs
+4
-8
src/libstd/io/buffered.rs
src/libstd/io/buffered.rs
+1
-1
src/libstd/time/duration.rs
src/libstd/time/duration.rs
+1
-1
未找到文件。
src/libcore/num/bignum.rs
浏览文件 @
9d6bd053
...
...
@@ -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
/under
flows.
/// 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.
...
...
src/libcore/num/mod.rs
浏览文件 @
9d6bd053
...
...
@@ -402,7 +402,7 @@ pub fn checked_add(self, rhs: Self) -> Option<Self> {
}
/// Checked integer subtraction. Computes `self - rhs`, returning
/// `None` if
und
erflow occurred.
/// `None` if
ov
erflow 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
und
erflow occurred.
/// `None` if
ov
erflow 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
///
...
...
src/libcore/ptr.rs
浏览文件 @
9d6bd053
...
...
@@ -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`.
...
...
src/libstd/io/buffered.rs
浏览文件 @
9d6bd053
...
...
@@ -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
und
erflows an `i64`, two
/// where `n` minus the internal buffer length
ov
erflows 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)`.
...
...
src/libstd/time/duration.rs
浏览文件 @
9d6bd053
...
...
@@ -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
und
erflow occurred.
/// if the result would be negative or if
ov
erflow 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录