Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
61fbdbba
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,发现更多精彩内容 >>
提交
61fbdbba
编写于
1月 11, 2017
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Debug implementations for libcollection structs
上级
a52da95c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
496 addition
and
0 deletion
+496
-0
src/libcollections/binary_heap.rs
src/libcollections/binary_heap.rs
+60
-0
src/libcollections/btree/map.rs
src/libcollections/btree/map.rs
+120
-0
src/libcollections/btree/set.rs
src/libcollections/btree/set.rs
+108
-0
src/libcollections/enum_set.rs
src/libcollections/enum_set.rs
+16
-0
src/libcollections/lib.rs
src/libcollections/lib.rs
+1
-0
src/libcollections/linked_list.rs
src/libcollections/linked_list.rs
+80
-0
src/libcollections/str.rs
src/libcollections/str.rs
+8
-0
src/libcollections/string.rs
src/libcollections/string.rs
+7
-0
src/libcollections/vec.rs
src/libcollections/vec.rs
+32
-0
src/libcollections/vec_deque.rs
src/libcollections/vec_deque.rs
+64
-0
未找到文件。
src/libcollections/binary_heap.rs
浏览文件 @
61fbdbba
...
...
@@ -228,6 +228,20 @@ pub struct PeekMut<'a, T: 'a + Ord> {
sift
:
bool
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
Ord
>
fmt
::
Debug
for
PeekMut
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"PeekMut { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
Ord
+
fmt
::
Debug
>
fmt
::
Debug
for
PeekMut
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
&
format!
(
"PeekMut({:?})"
,
self
.heap.data
[
0
]))
}
}
#[stable(feature
=
"binary_heap_peek_mut"
,
since
=
"1.12.0"
)]
impl
<
'a
,
T
:
Ord
>
Drop
for
PeekMut
<
'a
,
T
>
{
fn
drop
(
&
mut
self
)
{
...
...
@@ -968,6 +982,22 @@ pub struct Iter<'a, T: 'a> {
iter
:
slice
::
Iter
<
'a
,
T
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BinaryHeap::Iter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BinaryHeap::Iter"
)
.field
(
&
self
.iter
.as_slice
())
.finish
()
}
}
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Clone
for
Iter
<
'a
,
T
>
{
...
...
@@ -1016,6 +1046,22 @@ pub struct IntoIter<T> {
iter
:
vec
::
IntoIter
<
T
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
>
fmt
::
Debug
for
IntoIter
<
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BinaryHeap::IntoIter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
:
fmt
::
Debug
>
fmt
::
Debug
for
IntoIter
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BinaryHeap::IntoIter"
)
.field
(
&
self
.iter
.as_slice
())
.finish
()
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Iterator
for
IntoIter
<
T
>
{
type
Item
=
T
;
...
...
@@ -1055,6 +1101,20 @@ pub struct Drain<'a, T: 'a> {
iter
:
vec
::
Drain
<
'a
,
T
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Drain
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BinaryHeap::Drain { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Drain
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
&
format!
(
"BinaryHeap::Drain({:?})"
,
self
.iter
))
}
}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
impl
<
'a
,
T
:
'a
>
Iterator
for
Drain
<
'a
,
T
>
{
type
Item
=
T
;
...
...
src/libcollections/btree/map.rs
浏览文件 @
61fbdbba
...
...
@@ -270,6 +270,20 @@ pub struct Iter<'a, K: 'a, V: 'a> {
length
:
usize
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
Iter
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::Iter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Iter
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_list
()
.entries
(
self
.clone
())
.finish
()
}
}
/// A mutable iterator over a BTreeMap's entries.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
IterMut
<
'a
,
K
:
'a
,
V
:
'a
>
{
...
...
@@ -277,6 +291,20 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
length
:
usize
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
IterMut
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::IterMut { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
IterMut
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
&
format!
(
"BTreeMap::IterMut({:?})"
,
self
.range
))
}
}
/// An owning iterator over a BTreeMap's entries.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
IntoIter
<
K
,
V
>
{
...
...
@@ -285,30 +313,104 @@ pub struct IntoIter<K, V> {
length
:
usize
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
K
,
V
>
fmt
::
Debug
for
IntoIter
<
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::IntoIter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
K
:
fmt
::
Debug
,
V
:
fmt
::
Debug
>
fmt
::
Debug
for
IntoIter
<
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
let
range
=
Range
{
front
:
self
.front
.reborrow
(),
back
:
self
.back
.reborrow
(),
};
f
.debug_list
()
.entries
(
range
)
.finish
()
}
}
/// An iterator over a BTreeMap's keys.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
Keys
<
'a
,
K
:
'a
,
V
:
'a
>
{
inner
:
Iter
<
'a
,
K
,
V
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
Keys
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::Keys { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Keys
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_list
()
.entries
(
self
.inner
.clone
())
.finish
()
}
}
/// An iterator over a BTreeMap's values.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
Values
<
'a
,
K
:
'a
,
V
:
'a
>
{
inner
:
Iter
<
'a
,
K
,
V
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
Values
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::Values { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Values
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_list
()
.entries
(
self
.inner
.clone
())
.finish
()
}
}
/// A mutable iterator over a BTreeMap's values.
#[stable(feature
=
"map_values_mut"
,
since
=
"1.10.0"
)]
pub
struct
ValuesMut
<
'a
,
K
:
'a
,
V
:
'a
>
{
inner
:
IterMut
<
'a
,
K
,
V
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
ValuesMut
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::ValuesMut { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
ValuesMut
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
&
format!
(
"BTreeMap::ValuesMut({:?})"
,
self
.inner
))
}
}
/// An iterator over a sub-range of BTreeMap's entries.
pub
struct
Range
<
'a
,
K
:
'a
,
V
:
'a
>
{
front
:
Handle
<
NodeRef
<
marker
::
Immut
<
'a
>
,
K
,
V
,
marker
::
Leaf
>
,
marker
::
Edge
>
,
back
:
Handle
<
NodeRef
<
marker
::
Immut
<
'a
>
,
K
,
V
,
marker
::
Leaf
>
,
marker
::
Edge
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
Range
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::Range { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Range
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_list
()
.entries
(
self
.clone
())
.finish
()
}
}
/// A mutable iterator over a sub-range of BTreeMap's entries.
pub
struct
RangeMut
<
'a
,
K
:
'a
,
V
:
'a
>
{
front
:
Handle
<
NodeRef
<
marker
::
Mut
<
'a
>
,
K
,
V
,
marker
::
Leaf
>
,
marker
::
Edge
>
,
...
...
@@ -318,6 +420,24 @@ pub struct RangeMut<'a, K: 'a, V: 'a> {
_
marker
:
PhantomData
<&
'a
mut
(
K
,
V
)
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
,
V
:
'a
>
fmt
::
Debug
for
RangeMut
<
'a
,
K
,
V
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeMap::RangeMut { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
K
:
'a
+
fmt
::
Debug
,
V
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
RangeMut
<
'a
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
let
range
=
Range
{
front
:
self
.front
.reborrow
(),
back
:
self
.back
.reborrow
(),
};
f
.debug_list
()
.entries
(
range
)
.finish
()
}
}
/// A view into a single entry in a map, which may either be vacant or occupied.
/// This enum is constructed from the [`entry`] method on [`BTreeMap`].
///
...
...
src/libcollections/btree/set.rs
浏览文件 @
61fbdbba
...
...
@@ -85,6 +85,22 @@ pub struct Iter<'a, T: 'a> {
iter
:
Keys
<
'a
,
T
,
()
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::Iter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BTreeSet::Iter"
)
.field
(
&
self
.iter
.clone
())
.finish
()
}
}
/// An owning iterator over a `BTreeSet`'s items.
///
/// This structure is created by the `into_iter` method on [`BTreeSet`]
...
...
@@ -96,6 +112,20 @@ pub struct IntoIter<T> {
iter
:
::
btree_map
::
IntoIter
<
T
,
()
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
>
fmt
::
Debug
for
IntoIter
<
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::IntoIter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
:
fmt
::
Debug
>
fmt
::
Debug
for
IntoIter
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
&
format!
(
"BTreeSet::IntoIter({:?})"
,
self
.iter
))
}
}
/// An iterator over a sub-range of `BTreeSet`'s items.
///
/// This structure is created by the [`range`] method on [`BTreeSet`].
...
...
@@ -106,6 +136,20 @@ pub struct Range<'a, T: 'a> {
iter
:
::
btree_map
::
Range
<
'a
,
T
,
()
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Range
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::Range { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Range
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
&
format!
(
"BTreeSet::Range({:?})"
,
self
.iter
))
}
}
/// A lazy iterator producing elements in the set difference (in-order).
///
/// This structure is created by the [`difference`] method on [`BTreeSet`].
...
...
@@ -118,6 +162,22 @@ pub struct Difference<'a, T: 'a> {
b
:
Peekable
<
Iter
<
'a
,
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Difference
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::Difference { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Difference
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BTreeSet::Difference"
)
.field
(
&
self
.clone
())
.finish
()
}
}
/// A lazy iterator producing elements in the set symmetric difference (in-order).
///
/// This structure is created by the [`symmetric_difference`] method on
...
...
@@ -131,6 +191,22 @@ pub struct SymmetricDifference<'a, T: 'a> {
b
:
Peekable
<
Iter
<
'a
,
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
SymmetricDifference
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::SymmetricDifference { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
SymmetricDifference
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BTreeSet::SymmetricDifference"
)
.field
(
&
self
.clone
())
.finish
()
}
}
/// A lazy iterator producing elements in the set intersection (in-order).
///
/// This structure is created by the [`intersection`] method on [`BTreeSet`].
...
...
@@ -143,6 +219,22 @@ pub struct Intersection<'a, T: 'a> {
b
:
Peekable
<
Iter
<
'a
,
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Intersection
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::Intersection { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Intersection
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BTreeSet::Intersection"
)
.field
(
&
self
.clone
())
.finish
()
}
}
/// A lazy iterator producing elements in the set union (in-order).
///
/// This structure is created by the [`union`] method on [`BTreeSet`].
...
...
@@ -155,6 +247,22 @@ pub struct Union<'a, T: 'a> {
b
:
Peekable
<
Iter
<
'a
,
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Union
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"BTreeSet::Union { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Union
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"BTreeSet::Union"
)
.field
(
&
self
.clone
())
.finish
()
}
}
impl
<
T
:
Ord
>
BTreeSet
<
T
>
{
/// Makes a new `BTreeSet` with a reasonable choice of B.
///
...
...
src/libcollections/enum_set.rs
浏览文件 @
61fbdbba
...
...
@@ -220,6 +220,22 @@ pub struct Iter<E> {
marker
:
marker
::
PhantomData
<
E
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
E
>
fmt
::
Debug
for
Iter
<
E
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"EnumSet::Iter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
E
:
fmt
::
Debug
>
fmt
::
Debug
for
Iter
<
E
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"EnumSet::Iter"
)
.field
(
&
self
.clone
())
.finish
()
}
}
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl
<
E
>
Clone
for
Iter
<
E
>
{
fn
clone
(
&
self
)
->
Iter
<
E
>
{
...
...
src/libcollections/lib.rs
浏览文件 @
61fbdbba
...
...
@@ -28,6 +28,7 @@
#![cfg_attr(test,
allow(deprecated))]
// rand
#![deny(warnings)]
#![deny(missing_debug_implementations)]
#![feature(alloc)]
#![feature(allow_internal_unstable)]
...
...
src/libcollections/linked_list.rs
浏览文件 @
61fbdbba
...
...
@@ -65,6 +65,22 @@ pub struct Iter<'a, T: 'a> {
marker
:
PhantomData
<&
'a
Node
<
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"LinkedList::Iter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"LinkedList::Iter"
)
.field
(
&
self
.clone
())
.finish
()
}
}
// FIXME #19839: deriving is too aggressive on the bounds (T doesn't need to be Clone).
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Clone
for
Iter
<
'a
,
T
>
{
...
...
@@ -82,6 +98,22 @@ pub struct IterMut<'a, T: 'a> {
len
:
usize
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
IterMut
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"LinkedList::IterMut { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
IterMut
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"LinkedList::IterMut"
)
.field
(
self
.clone
())
.finish
()
}
}
/// An iterator over the elements of a `LinkedList`.
#[derive(Clone)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
...
...
@@ -89,6 +121,22 @@ pub struct IntoIter<T> {
list
:
LinkedList
<
T
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
>
fmt
::
Debug
for
IntoIter
<
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"LinkedList::IntoIter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
:
fmt
::
Debug
>
fmt
::
Debug
for
IntoIter
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"LinkedList::IntoIter"
)
.field
(
self
.clone
())
.finish
()
}
}
impl
<
T
>
Node
<
T
>
{
fn
new
(
element
:
T
)
->
Self
{
Node
{
...
...
@@ -1077,6 +1125,22 @@ pub struct FrontPlace<'a, T: 'a> {
node
:
IntermediateBox
<
Node
<
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
FrontPlace
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"LinkedList::FrontPlace { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
FrontPlace
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"LinkedList::FrontPlace"
)
.field
(
self
.clone
())
.finish
()
}
}
#[unstable(feature
=
"collection_placement"
,
reason
=
"placement protocol is subject to change"
,
issue
=
"30172"
)]
...
...
@@ -1121,6 +1185,22 @@ pub struct BackPlace<'a, T: 'a> {
node
:
IntermediateBox
<
Node
<
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
BackPlace
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"LinkedList::BackPlace { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
BackPlace
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"LinkedList::BackPlace"
)
.field
(
self
.clone
())
.finish
()
}
}
#[unstable(feature
=
"collection_placement"
,
reason
=
"placement protocol is subject to change"
,
issue
=
"30172"
)]
...
...
src/libcollections/str.rs
浏览文件 @
61fbdbba
...
...
@@ -19,6 +19,7 @@
// It's cleaner to just turn off the unused_imports warning than to fix them.
#![allow(unused_imports)]
use
core
::
fmt
;
use
core
::
str
as
core_str
;
use
core
::
str
::
pattern
::
Pattern
;
use
core
::
str
::
pattern
::{
Searcher
,
ReverseSearcher
,
DoubleEndedSearcher
};
...
...
@@ -122,6 +123,13 @@ pub struct EncodeUtf16<'a> {
encoder
:
Utf16Encoder
<
Chars
<
'a
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
>
fmt
::
Debug
for
EncodeUtf16
<
'a
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"EncodeUtf16 { .. }"
)
}
}
#[stable(feature
=
"encode_utf16"
,
since
=
"1.8.0"
)]
impl
<
'a
>
Iterator
for
EncodeUtf16
<
'a
>
{
type
Item
=
u16
;
...
...
src/libcollections/string.rs
浏览文件 @
61fbdbba
...
...
@@ -1979,6 +1979,13 @@ pub struct Drain<'a> {
iter
:
Chars
<
'a
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
>
fmt
::
Debug
for
Drain
<
'a
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"String::Drain { .. }"
)
}
}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
unsafe
impl
<
'a
>
Sync
for
Drain
<
'a
>
{}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
...
...
src/libcollections/vec.rs
浏览文件 @
61fbdbba
...
...
@@ -2092,6 +2092,22 @@ pub struct Drain<'a, T: 'a> {
vec
:
Shared
<
Vec
<
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Drain
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"Vec::Drain { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Drain
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"Vec::Drain"
)
.field
(
&
self
.iter
.as_slice
())
.finish
()
}
}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
unsafe
impl
<
'a
,
T
:
Sync
>
Sync
for
Drain
<
'a
,
T
>
{}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
...
...
@@ -2162,6 +2178,22 @@ pub struct PlaceBack<'a, T: 'a> {
vec
:
&
'a
mut
Vec
<
T
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
PlaceBack
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"Vec::PlaceBack { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
PlaceBack
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"Vec::PlaceBack"
)
.field
(
&
self
.vec
.as_slice
())
.finish
()
}
}
#[unstable(feature
=
"collection_placement"
,
reason
=
"placement protocol is subject to change"
,
issue
=
"30172"
)]
...
...
src/libcollections/vec_deque.rs
浏览文件 @
61fbdbba
...
...
@@ -1866,6 +1866,22 @@ pub struct Iter<'a, T: 'a> {
head
:
usize
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"VecDeque::Iter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Iter
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"VecDeque::Iter"
)
.field
(
&
self
.clone
())
.finish
()
}
}
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Clone
for
Iter
<
'a
,
T
>
{
...
...
@@ -1938,6 +1954,22 @@ pub struct IterMut<'a, T: 'a> {
head
:
usize
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
IterMut
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"VecDeque::IterMut { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
IterMut
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"VecDeque::IterMut"
)
.field
(
&
self
.clone
())
.finish
()
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
>
Iterator
for
IterMut
<
'a
,
T
>
{
type
Item
=
&
'a
mut
T
;
...
...
@@ -2004,6 +2036,22 @@ pub struct IntoIter<T> {
inner
:
VecDeque
<
T
>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
>
fmt
::
Debug
for
IntoIter
<
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"VecDeque::IntoIter { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
T
:
fmt
::
Debug
>
fmt
::
Debug
for
IntoIter
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"VecDeque::IntoIter"
)
.field
(
&
self
.clone
())
.finish
()
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
Iterator
for
IntoIter
<
T
>
{
type
Item
=
T
;
...
...
@@ -2047,6 +2095,22 @@ pub struct Drain<'a, T: 'a> {
deque
:
Shared
<
VecDeque
<
T
>>
,
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
>
fmt
::
Debug
for
Drain
<
'a
,
T
>
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.pad
(
"VecDeque::Drain { .. }"
)
}
}
#[stable(feature
=
"collection_debug"
,
since
=
"1.15.0"
)]
impl
<
'a
,
T
:
'a
+
fmt
::
Debug
>
fmt
::
Debug
for
Drain
<
'a
,
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.debug_tuple
(
"VecDeque::Drain"
)
.field
(
&
self
.clone
())
.finish
()
}
}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
unsafe
impl
<
'a
,
T
:
Sync
>
Sync
for
Drain
<
'a
,
T
>
{}
#[stable(feature
=
"drain"
,
since
=
"1.6.0"
)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录