Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
90f06ae3
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,发现更多精彩内容 >>
提交
90f06ae3
编写于
3月 13, 2015
作者:
A
Andrew Paseltiner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
document undefined collection behavior with interior mutability
closes #23327
上级
ee769638
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
0 deletion
+29
-0
src/libcollections/binary_heap.rs
src/libcollections/binary_heap.rs
+5
-0
src/libcollections/btree/map.rs
src/libcollections/btree/map.rs
+4
-0
src/libcollections/btree/set.rs
src/libcollections/btree/set.rs
+4
-0
src/libcollections/enum_set.rs
src/libcollections/enum_set.rs
+5
-0
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/map.rs
+5
-0
src/libstd/collections/hash/set.rs
src/libstd/collections/hash/set.rs
+6
-0
未找到文件。
src/libcollections/binary_heap.rs
浏览文件 @
90f06ae3
...
...
@@ -163,6 +163,11 @@
/// A priority queue implemented with a binary heap.
///
/// This will be a max-heap.
///
/// It is a logic error for an item to be modified in such a way that the
/// item's ordering relative to any other item, as determined by the `Ord`
/// trait, changes while it is in the heap. This is normally only possible
/// through `Cell`, `RefCell`, global state, I/O, or unsafe code.
#[derive(Clone)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
BinaryHeap
<
T
>
{
...
...
src/libcollections/btree/map.rs
浏览文件 @
90f06ae3
...
...
@@ -64,6 +64,10 @@
/// and possibly other factors. Using linear search, searching for a random element is expected
/// to take O(B log<sub>B</sub>n) comparisons, which is generally worse than a BST. In practice,
/// however, performance is excellent.
///
/// It is a logic error for a key to be modified in such a way that the key's ordering relative to
/// any other key, as determined by the `Ord` trait, changes while it is in the map. This is
/// normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe code.
#[derive(Clone)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
BTreeMap
<
K
,
V
>
{
...
...
src/libcollections/btree/set.rs
浏览文件 @
90f06ae3
...
...
@@ -30,6 +30,10 @@
///
/// See BTreeMap's documentation for a detailed discussion of this collection's performance
/// benefits and drawbacks.
///
/// It is a logic error for an item to be modified in such a way that the item's ordering relative
/// to any other item, as determined by the `Ord` trait, changes while it is in the set. This is
/// normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe code.
#[derive(Clone,
Hash,
PartialEq,
Eq,
Ord,
PartialOrd)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
BTreeSet
<
T
>
{
...
...
src/libcollections/enum_set.rs
浏览文件 @
90f06ae3
...
...
@@ -24,6 +24,11 @@
#[derive(Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash)]
/// A specialized set implementation to use enum types.
///
/// It is a logic error for an item to be modified in such a way that the transformation of the
/// item to or from a `usize`, as determined by the `CLike` trait, changes while the item is in the
/// set. This is normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe
/// code.
pub
struct
EnumSet
<
E
>
{
// We must maintain the invariant that no bits are set
// for which no variant exists
...
...
src/libstd/collections/hash/map.rs
浏览文件 @
90f06ae3
...
...
@@ -217,6 +217,11 @@ fn test_resize_policy() {
/// It is required that the keys implement the `Eq` and `Hash` traits, although
/// this can frequently be achieved by using `#[derive(Eq, Hash)]`.
///
/// It is a logic error for a key to be modified in such a way that the key's
/// hash, as determined by the `Hash` trait, or its equality, as determined by
/// the `Eq` trait, changes while it is in the map. This is normally only
/// possible through `Cell`, `RefCell`, global state, I/O, or unsafe code.
///
/// Relevant papers/articles:
///
/// 1. Pedro Celis. ["Robin Hood Hashing"](https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf)
...
...
src/libstd/collections/hash/set.rs
浏览文件 @
90f06ae3
...
...
@@ -38,6 +38,12 @@
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
/// requires that the elements implement the `Eq` and `Hash` traits.
///
/// It is a logic error for an item to be modified in such a way that the
/// item's hash, as determined by the `Hash` trait, or its equality, as
/// determined by the `Eq` trait, changes while it is in the set. This is
/// normally only possible through `Cell`, `RefCell`, global state, I/O, or
/// unsafe code.
///
/// # Examples
///
/// ```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录