Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
686648d1
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,发现更多精彩内容 >>
提交
686648d1
编写于
2月 22, 2015
作者:
M
Manish Goregaokar
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #22584 - alexcrichton:snapshots, r=Gankro
上级
5d7b216f
6686f7aa
变更
41
展开全部
隐藏空白更改
内联
并排
Showing
41 changed file
with
20 addition
and
5242 deletion
+20
-5242
src/liballoc/arc.rs
src/liballoc/arc.rs
+0
-7
src/liballoc/boxed.rs
src/liballoc/boxed.rs
+0
-8
src/liballoc/rc.rs
src/liballoc/rc.rs
+0
-8
src/libcollections/bit.rs
src/libcollections/bit.rs
+0
-20
src/libcollections/borrow.rs
src/libcollections/borrow.rs
+0
-10
src/libcollections/borrow_stage0.rs
src/libcollections/borrow_stage0.rs
+0
-313
src/libcollections/btree/map.rs
src/libcollections/btree/map.rs
+0
-10
src/libcollections/lib.rs
src/libcollections/lib.rs
+3
-9
src/libcollections/linked_list.rs
src/libcollections/linked_list.rs
+0
-13
src/libcollections/string.rs
src/libcollections/string.rs
+0
-9
src/libcollections/vec.rs
src/libcollections/vec.rs
+1
-11
src/libcollections/vec_deque.rs
src/libcollections/vec_deque.rs
+0
-12
src/libcollections/vec_map.rs
src/libcollections/vec_map.rs
+0
-15
src/libcore/array.rs
src/libcore/array.rs
+0
-7
src/libcore/hash/mod.rs
src/libcore/hash/mod.rs
+0
-199
src/libcore/hash/sip.rs
src/libcore/hash/sip.rs
+0
-19
src/libcore/marker.rs
src/libcore/marker.rs
+0
-28
src/librustc/lint/mod.rs
src/librustc/lint/mod.rs
+0
-8
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+0
-42
src/librustc/middle/ty.rs
src/librustc/middle/ty.rs
+0
-15
src/librustc/util/common.rs
src/librustc/util/common.rs
+6
-97
src/librustc/util/nodemap.rs
src/librustc/util/nodemap.rs
+0
-31
src/librustc/util/ppaux.rs
src/librustc/util/ppaux.rs
+0
-18
src/libserialize/collection_impls.rs
src/libserialize/collection_impls.rs
+0
-78
src/libstd/collections/hash/map_stage0.rs
src/libstd/collections/hash/map_stage0.rs
+0
-2330
src/libstd/collections/hash/mod.rs
src/libstd/collections/hash/mod.rs
+0
-8
src/libstd/collections/hash/set_stage0.rs
src/libstd/collections/hash/set_stage0.rs
+0
-1252
src/libstd/collections/hash/table.rs
src/libstd/collections/hash/table.rs
+0
-19
src/libstd/ffi/os_str.rs
src/libstd/ffi/os_str.rs
+0
-17
src/libstd/net/addr.rs
src/libstd/net/addr.rs
+0
-15
src/libstd/net/ip.rs
src/libstd/net/ip.rs
+0
-14
src/libstd/old_io/process.rs
src/libstd/old_io/process.rs
+1
-13
src/libstd/old_path/posix.rs
src/libstd/old_path/posix.rs
+0
-8
src/libstd/old_path/windows.rs
src/libstd/old_path/windows.rs
+0
-15
src/libstd/sys/common/wtf8.rs
src/libstd/sys/common/wtf8.rs
+0
-27
src/libstd/sys/unix/process.rs
src/libstd/sys/unix/process.rs
+0
-258
src/libstd/sys/windows/process.rs
src/libstd/sys/windows/process.rs
+0
-194
src/libstd/thunk.rs
src/libstd/thunk.rs
+0
-3
src/libsyntax/ptr.rs
src/libsyntax/ptr.rs
+0
-7
src/libsyntax/util/interner.rs
src/libsyntax/util/interner.rs
+0
-75
src/snapshots.txt
src/snapshots.txt
+9
-0
未找到文件。
src/liballoc/arc.rs
浏览文件 @
686648d1
...
...
@@ -598,13 +598,6 @@ impl<T: Default + Sync + Send> Default for Arc<T> {
fn
default
()
->
Arc
<
T
>
{
Arc
::
new
(
Default
::
default
())
}
}
#[cfg(stage0)]
impl
<
H
:
Hasher
,
T
:
Hash
<
H
>>
Hash
<
H
>
for
Arc
<
T
>
{
fn
hash
(
&
self
,
state
:
&
mut
H
)
{
(
**
self
)
.hash
(
state
)
}
}
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
Hash
>
Hash
for
Arc
<
T
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
...
...
src/liballoc/boxed.rs
浏览文件 @
686648d1
...
...
@@ -220,14 +220,6 @@ fn cmp(&self, other: &Box<T>) -> Ordering {
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
?
Sized
+
Eq
>
Eq
for
Box
<
T
>
{}
#[cfg(stage0)]
impl
<
S
:
hash
::
Hasher
,
T
:
?
Sized
+
Hash
<
S
>>
Hash
<
S
>
for
Box
<
T
>
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
(
**
self
)
.hash
(
state
);
}
}
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
?
Sized
+
Hash
>
Hash
for
Box
<
T
>
{
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
...
...
src/liballoc/rc.rs
浏览文件 @
686648d1
...
...
@@ -592,14 +592,6 @@ fn cmp(&self, other: &Rc<T>) -> Ordering { (**self).cmp(&**other) }
}
// FIXME (#18248) Make `T` `Sized?`
#[cfg(stage0)]
impl
<
S
:
Hasher
,
T
:
Hash
<
S
>>
Hash
<
S
>
for
Rc
<
T
>
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
(
**
self
)
.hash
(
state
);
}
}
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
Hash
>
Hash
for
Rc
<
T
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
...
...
src/libcollections/bit.rs
浏览文件 @
686648d1
...
...
@@ -985,17 +985,6 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
impl
<
S
:
hash
::
Writer
+
hash
::
Hasher
>
hash
::
Hash
<
S
>
for
BitVec
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
self
.nbits
.hash
(
state
);
for
elem
in
self
.blocks
()
{
elem
.hash
(
state
);
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
hash
::
Hash
for
BitVec
{
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
self
.nbits
.hash
(
state
);
...
...
@@ -1776,16 +1765,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
}
}
#[cfg(stage0)]
impl
<
S
:
hash
::
Writer
+
hash
::
Hasher
>
hash
::
Hash
<
S
>
for
BitSet
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
for
pos
in
self
{
pos
.hash
(
state
);
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
hash
::
Hash
for
BitSet
{
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
for
pos
in
self
{
...
...
src/libcollections/borrow.rs
浏览文件 @
686648d1
...
...
@@ -282,16 +282,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
impl
<
'a
,
B
:
?
Sized
,
S
:
Hasher
>
Hash
<
S
>
for
Cow
<
'a
,
B
>
where
B
:
Hash
<
S
>
+
ToOwned
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
Hash
::
hash
(
&**
self
,
state
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
<
'a
,
B
:
?
Sized
>
Hash
for
Cow
<
'a
,
B
>
where
B
:
Hash
+
ToOwned
{
#[inline]
...
...
src/libcollections/borrow_stage0.rs
已删除
100644 → 0
浏览文件 @
5d7b216f
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! A module for working with borrowed data.
#![stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
use
core
::
clone
::
Clone
;
use
core
::
cmp
::{
Eq
,
Ord
,
Ordering
,
PartialEq
,
PartialOrd
};
use
core
::
hash
::{
Hash
,
Hasher
};
use
core
::
marker
::
Sized
;
use
core
::
ops
::
Deref
;
use
core
::
option
::
Option
;
use
fmt
;
use
alloc
::{
rc
,
arc
};
use
self
::
Cow
::
*
;
/// A trait for borrowing data.
///
/// In general, there may be several ways to "borrow" a piece of data. The
/// typical ways of borrowing a type `T` are `&T` (a shared borrow) and `&mut T`
/// (a mutable borrow). But types like `Vec<T>` provide additional kinds of
/// borrows: the borrowed slices `&[T]` and `&mut [T]`.
///
/// When writing generic code, it is often desirable to abstract over all ways
/// of borrowing data from a given type. That is the role of the `Borrow`
/// trait: if `T: Borrow<U>`, then `&U` can be borrowed from `&T`. A given
/// type can be borrowed as multiple different types. In particular, `Vec<T>:
/// Borrow<Vec<T>>` and `Vec<T>: Borrow<[T]>`.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
Borrow
<
Borrowed
:
?
Sized
>
{
/// Immutably borrow from an owned value.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
borrow
(
&
self
)
->
&
Borrowed
;
}
/// A trait for mutably borrowing data.
///
/// Similar to `Borrow`, but for mutable borrows.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
BorrowMut
<
Borrowed
:
?
Sized
>
:
Borrow
<
Borrowed
>
{
/// Mutably borrow from an owned value.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
borrow_mut
(
&
mut
self
)
->
&
mut
Borrowed
;
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
?
Sized
>
Borrow
<
T
>
for
T
{
fn
borrow
(
&
self
)
->
&
T
{
self
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
?
Sized
>
BorrowMut
<
T
>
for
T
{
fn
borrow_mut
(
&
mut
self
)
->
&
mut
T
{
self
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
:
?
Sized
>
Borrow
<
T
>
for
&
'a
T
{
fn
borrow
(
&
self
)
->
&
T
{
&**
self
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
:
?
Sized
>
Borrow
<
T
>
for
&
'a
mut
T
{
fn
borrow
(
&
self
)
->
&
T
{
&**
self
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
T
:
?
Sized
>
BorrowMut
<
T
>
for
&
'a
mut
T
{
fn
borrow_mut
(
&
mut
self
)
->
&
mut
T
{
&
mut
**
self
}
}
impl
<
T
>
Borrow
<
T
>
for
rc
::
Rc
<
T
>
{
fn
borrow
(
&
self
)
->
&
T
{
&**
self
}
}
impl
<
T
>
Borrow
<
T
>
for
arc
::
Arc
<
T
>
{
fn
borrow
(
&
self
)
->
&
T
{
&**
self
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
Borrow
<
B
>
for
Cow
<
'a
,
B
>
where
B
:
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{
fn
borrow
(
&
self
)
->
&
B
{
&**
self
}
}
/// A generalization of Clone to borrowed data.
///
/// Some types make it possible to go from borrowed to owned, usually by
/// implementing the `Clone` trait. But `Clone` works only for going from `&T`
/// to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data
/// from any borrow of a given type.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
ToOwned
{
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
type
Owned
:
Borrow
<
Self
>
;
/// Create owned data from borrowed data, usually by copying.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
to_owned
(
&
self
)
->
Self
::
Owned
;
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
>
ToOwned
for
T
where
T
:
Clone
{
type
Owned
=
T
;
fn
to_owned
(
&
self
)
->
T
{
self
.clone
()
}
}
/// A clone-on-write smart pointer.
///
/// The type `Cow` is a smart pointer providing clone-on-write functionality: it
/// can enclose and provide immutable access to borrowed data, and clone the
/// data lazily when mutation or ownership is required. The type is designed to
/// work with general borrowed data via the `Borrow` trait.
///
/// `Cow` implements both `Deref`, which means that you can call
/// non-mutating methods directly on the data it encloses. If mutation
/// is desired, `to_mut` will obtain a mutable references to an owned
/// value, cloning if necessary.
///
/// # Example
///
/// ```rust
/// use std::borrow::Cow;
///
/// fn abs_all(input: &mut Cow<[int]>) {
/// for i in 0..input.len() {
/// let v = input[i];
/// if v < 0 {
/// // clones into a vector the first time (if not already owned)
/// input.to_mut()[i] = -v;
/// }
/// }
/// }
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
enum
Cow
<
'a
,
B
:
?
Sized
+
'a
>
where
B
:
ToOwned
{
/// Borrowed data.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
Borrowed
(
&
'a
B
),
/// Owned data.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
Owned
(
<
B
as
ToOwned
>
::
Owned
)
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
Clone
for
Cow
<
'a
,
B
>
where
B
:
ToOwned
{
fn
clone
(
&
self
)
->
Cow
<
'a
,
B
>
{
match
*
self
{
Borrowed
(
b
)
=>
Borrowed
(
b
),
Owned
(
ref
o
)
=>
{
let
b
:
&
B
=
o
.borrow
();
Owned
(
b
.to_owned
())
},
}
}
}
impl
<
'a
,
B
:
?
Sized
>
Cow
<
'a
,
B
>
where
B
:
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{
/// Acquire a mutable reference to the owned form of the data.
///
/// Copies the data if it is not already owned.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
fn
to_mut
(
&
mut
self
)
->
&
mut
<
B
as
ToOwned
>
::
Owned
where
<
B
as
ToOwned
>
::
Owned
:
'a
{
match
*
self
{
Borrowed
(
borrowed
)
=>
{
*
self
=
Owned
(
borrowed
.to_owned
());
self
.to_mut
()
}
Owned
(
ref
mut
owned
)
=>
owned
}
}
/// Extract the owned data.
///
/// Copies the data if it is not already owned.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
fn
into_owned
(
self
)
->
<
B
as
ToOwned
>
::
Owned
{
match
self
{
Borrowed
(
borrowed
)
=>
borrowed
.to_owned
(),
Owned
(
owned
)
=>
owned
}
}
/// Returns true if this `Cow` wraps a borrowed value
#[deprecated(since
=
"1.0.0"
,
reason
=
"match on the enum instead"
)]
#[unstable(feature
=
"std_misc"
)]
pub
fn
is_borrowed
(
&
self
)
->
bool
{
match
*
self
{
Borrowed
(
_
)
=>
true
,
_
=>
false
,
}
}
/// Returns true if this `Cow` wraps an owned value
#[deprecated(since
=
"1.0.0"
,
reason
=
"match on the enum instead"
)]
#[unstable(feature
=
"std_misc"
)]
pub
fn
is_owned
(
&
self
)
->
bool
{
match
*
self
{
Owned
(
_
)
=>
true
,
_
=>
false
,
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
Deref
for
Cow
<
'a
,
B
>
where
B
:
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{
type
Target
=
B
;
fn
deref
(
&
self
)
->
&
B
{
match
*
self
{
Borrowed
(
borrowed
)
=>
borrowed
,
Owned
(
ref
owned
)
=>
owned
.borrow
()
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
Eq
for
Cow
<
'a
,
B
>
where
B
:
Eq
+
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
Ord
for
Cow
<
'a
,
B
>
where
B
:
Ord
+
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{
#[inline]
fn
cmp
(
&
self
,
other
:
&
Cow
<
'a
,
B
>
)
->
Ordering
{
Ord
::
cmp
(
&**
self
,
&**
other
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
'b
,
B
:
?
Sized
,
C
:
?
Sized
>
PartialEq
<
Cow
<
'b
,
C
>>
for
Cow
<
'a
,
B
>
where
B
:
PartialEq
<
C
>
+
ToOwned
,
C
:
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
,
<
C
as
ToOwned
>
::
Owned
:
'b
,
{
#[inline]
fn
eq
(
&
self
,
other
:
&
Cow
<
'b
,
C
>
)
->
bool
{
PartialEq
::
eq
(
&**
self
,
&**
other
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
PartialOrd
for
Cow
<
'a
,
B
>
where
B
:
PartialOrd
+
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{
#[inline]
fn
partial_cmp
(
&
self
,
other
:
&
Cow
<
'a
,
B
>
)
->
Option
<
Ordering
>
{
PartialOrd
::
partial_cmp
(
&**
self
,
&**
other
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
fmt
::
Debug
for
Cow
<
'a
,
B
>
where
B
:
fmt
::
Debug
+
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
fmt
::
Debug
,
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
match
*
self
{
Borrowed
(
ref
b
)
=>
fmt
::
Debug
::
fmt
(
b
,
f
),
Owned
(
ref
o
)
=>
fmt
::
Debug
::
fmt
(
o
,
f
),
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
fmt
::
Display
for
Cow
<
'a
,
B
>
where
B
:
fmt
::
Display
+
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
fmt
::
Display
,
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
match
*
self
{
Borrowed
(
ref
b
)
=>
fmt
::
Display
::
fmt
(
b
,
f
),
Owned
(
ref
o
)
=>
fmt
::
Display
::
fmt
(
o
,
f
),
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
,
S
:
Hasher
>
Hash
<
S
>
for
Cow
<
'a
,
B
>
where
B
:
Hash
<
S
>
+
ToOwned
,
<
B
as
ToOwned
>
::
Owned
:
'a
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
Hash
::
hash
(
&**
self
,
state
)
}
}
/// Trait for moving into a `Cow`
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
IntoCow
<
'a
,
B
:
?
Sized
>
where
B
:
ToOwned
{
/// Moves `self` into `Cow`
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
into_cow
(
self
)
->
Cow
<
'a
,
B
>
;
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
'a
,
B
:
?
Sized
>
IntoCow
<
'a
,
B
>
for
Cow
<
'a
,
B
>
where
B
:
ToOwned
{
fn
into_cow
(
self
)
->
Cow
<
'a
,
B
>
{
self
}
}
src/libcollections/btree/map.rs
浏览文件 @
686648d1
...
...
@@ -852,16 +852,6 @@ fn extend<T: IntoIterator<Item=(K, V)>>(&mut self, iter: T) {
}
}
#[cfg(stage0)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
S
:
Hasher
,
K
:
Hash
<
S
>
,
V
:
Hash
<
S
>>
Hash
<
S
>
for
BTreeMap
<
K
,
V
>
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
for
elt
in
self
{
elt
.hash
(
state
);
}
}
}
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
K
:
Hash
,
V
:
Hash
>
Hash
for
BTreeMap
<
K
,
V
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
...
...
src/libcollections/lib.rs
浏览文件 @
686648d1
...
...
@@ -86,23 +86,17 @@
pub
mod
binary_heap
;
mod
bit
;
mod
btree
;
pub
mod
linked_list
;
pub
mod
borrow
;
pub
mod
enum_set
;
pub
mod
fmt
;
pub
mod
vec_deque
;
pub
mod
linked_list
;
pub
mod
slice
;
pub
mod
str
;
pub
mod
string
;
pub
mod
vec
;
pub
mod
vec_deque
;
pub
mod
vec_map
;
#[cfg(stage0)]
#[path
=
"borrow_stage0.rs"
]
pub
mod
borrow
;
#[cfg(not(stage0))]
pub
mod
borrow
;
#[unstable(feature
=
"collections"
,
reason
=
"RFC 509"
)]
pub
mod
bit_vec
{
...
...
src/libcollections/linked_list.rs
浏览文件 @
686648d1
...
...
@@ -28,8 +28,6 @@
use
core
::
default
::
Default
;
use
core
::
fmt
;
use
core
::
hash
::{
Hasher
,
Hash
};
#[cfg(stage0)]
use
core
::
hash
::
Writer
;
use
core
::
iter
::{
self
,
FromIterator
,
IntoIterator
};
use
core
::
mem
;
use
core
::
ptr
;
...
...
@@ -932,17 +930,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
impl
<
S
:
Writer
+
Hasher
,
A
:
Hash
<
S
>>
Hash
<
S
>
for
LinkedList
<
A
>
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
self
.len
()
.hash
(
state
);
for
elt
in
self
{
elt
.hash
(
state
);
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
<
A
:
Hash
>
Hash
for
LinkedList
<
A
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
self
.len
()
.hash
(
state
);
...
...
src/libcollections/string.rs
浏览文件 @
686648d1
...
...
@@ -834,16 +834,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
}
#[unstable(feature
=
"collections"
,
reason
=
"waiting on Hash stabilization"
)]
#[cfg(stage0)]
impl
<
H
:
hash
::
Writer
+
hash
::
Hasher
>
hash
::
Hash
<
H
>
for
String
{
#[inline]
fn
hash
(
&
self
,
hasher
:
&
mut
H
)
{
(
**
self
)
.hash
(
hasher
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
hash
::
Hash
for
String
{
#[inline]
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
hasher
:
&
mut
H
)
{
...
...
src/libcollections/vec.rs
浏览文件 @
686648d1
...
...
@@ -1303,15 +1303,7 @@ fn clone_from(&mut self, other: &Vec<T>) {
}
}
#[cfg(stage0)]
impl
<
S
:
hash
::
Writer
+
hash
::
Hasher
,
T
:
Hash
<
S
>>
Hash
<
S
>
for
Vec
<
T
>
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
Hash
::
hash
(
&**
self
,
state
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
<
T
:
Hash
>
Hash
for
Vec
<
T
>
{
#[inline]
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
...
...
@@ -1599,9 +1591,7 @@ impl<T> AsSlice<T> for Vec<T> {
fn
as_slice
(
&
self
)
->
&
[
T
]
{
unsafe
{
let
p
=
*
self
.ptr
;
if
cfg!
(
not
(
stage0
))
{
// NOTE remove cfg after next snapshot
assume
(
p
!=
0
as
*
mut
T
);
}
assume
(
p
!=
0
as
*
mut
T
);
mem
::
transmute
(
RawSlice
{
data
:
p
,
len
:
self
.len
...
...
src/libcollections/vec_deque.rs
浏览文件 @
686648d1
...
...
@@ -32,7 +32,6 @@
use
core
::
raw
::
Slice
as
RawSlice
;
use
core
::
hash
::{
Hash
,
Hasher
};
#[cfg(stage0)]
use
core
::
hash
::
Writer
;
use
core
::
cmp
;
use
alloc
::
heap
;
...
...
@@ -1675,17 +1674,6 @@ fn cmp(&self, other: &VecDeque<A>) -> Ordering {
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(stage0)]
impl
<
S
:
Writer
+
Hasher
,
A
:
Hash
<
S
>>
Hash
<
S
>
for
VecDeque
<
A
>
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
self
.len
()
.hash
(
state
);
for
elt
in
self
{
elt
.hash
(
state
);
}
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
<
A
:
Hash
>
Hash
for
VecDeque
<
A
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
self
.len
()
.hash
(
state
);
...
...
src/libcollections/vec_map.rs
浏览文件 @
686648d1
...
...
@@ -21,7 +21,6 @@
use
core
::
default
::
Default
;
use
core
::
fmt
;
use
core
::
hash
::{
Hash
,
Hasher
};
#[cfg(stage0)]
use
core
::
hash
::
Writer
;
use
core
::
iter
::{
Enumerate
,
FilterMap
,
Map
,
FromIterator
,
IntoIterator
};
use
core
::
iter
;
use
core
::
mem
::
replace
;
...
...
@@ -113,21 +112,7 @@ fn clone_from(&mut self, source: &VecMap<V>) {
}
}
#[cfg(stage0)]
impl
<
S
:
Writer
+
Hasher
,
V
:
Hash
<
S
>>
Hash
<
S
>
for
VecMap
<
V
>
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
// In order to not traverse the `VecMap` twice, count the elements
// during iteration.
let
mut
count
:
usize
=
0
;
for
elt
in
self
{
elt
.hash
(
state
);
count
+=
1
;
}
count
.hash
(
state
);
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[cfg(not(stage0))]
impl
<
V
:
Hash
>
Hash
for
VecMap
<
V
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
// In order to not traverse the `VecMap` twice, count the elements
...
...
src/libcore/array.rs
浏览文件 @
686648d1
...
...
@@ -35,13 +35,6 @@
}
}
#[cfg(stage0)]
impl
<
S
:
hash
::
Writer
+
hash
::
Hasher
,
T
:
Hash
<
S
>>
Hash
<
S
>
for
[
T
;
$N
]
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
Hash
::
hash
(
&
self
[
..
],
state
)
}
}
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
<
T
:
Hash
>
Hash
for
[
T
;
$N
]
{
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
...
...
src/libcore/hash/mod.rs
浏览文件 @
686648d1
...
...
@@ -73,7 +73,6 @@
/// to compute the hash. Specific implementations of this trait may specialize
/// for particular instances of `H` in order to be able to optimize the hashing
/// behavior.
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
Hash
{
/// Feeds this value into the state given, updating the hasher as necessary.
...
...
@@ -89,72 +88,40 @@ fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized {
}
}
/// A hashable type.
///
/// The `H` type parameter is an abstract hash state that is used by the `Hash`
/// to compute the hash. Specific implementations of this trait may specialize
/// for particular instances of `H` in order to be able to optimize the hashing
/// behavior.
#[cfg(stage0)]
pub
trait
Hash
<
H
:
Hasher
>
{
/// Feeds this value into the state given, updating the hasher as necessary.
fn
hash
(
&
self
,
state
:
&
mut
H
);
}
/// A trait which represents the ability to hash an arbitrary stream of bytes.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
Hasher
{
/// Result type of one run of hashing generated by this hasher.
#[cfg(stage0)]
type
Output
;
/// Resets this hasher back to its initial state (as if it were just
/// created).
#[cfg(stage0)]
fn
reset
(
&
mut
self
);
/// Completes a round of hashing, producing the output hash generated.
#[cfg(stage0)]
fn
finish
(
&
self
)
->
Self
::
Output
;
/// Completes a round of hashing, producing the output hash generated.
#[cfg(not(stage0))]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
finish
(
&
self
)
->
u64
;
/// Writes some data into this `Hasher`
#[cfg(not(stage0))]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
fn
write
(
&
mut
self
,
bytes
:
&
[
u8
]);
/// Write a single `u8` into this hasher
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_u8
(
&
mut
self
,
i
:
u8
)
{
self
.write
(
&
[
i
])
}
/// Write a single `u16` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_u16
(
&
mut
self
,
i
:
u16
)
{
self
.write
(
&
unsafe
{
mem
::
transmute
::
<
_
,
[
u8
;
2
]
>
(
i
)
})
}
/// Write a single `u32` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_u32
(
&
mut
self
,
i
:
u32
)
{
self
.write
(
&
unsafe
{
mem
::
transmute
::
<
_
,
[
u8
;
4
]
>
(
i
)
})
}
/// Write a single `u64` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_u64
(
&
mut
self
,
i
:
u64
)
{
self
.write
(
&
unsafe
{
mem
::
transmute
::
<
_
,
[
u8
;
8
]
>
(
i
)
})
}
/// Write a single `usize` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_usize
(
&
mut
self
,
i
:
usize
)
{
...
...
@@ -166,58 +133,31 @@ fn write_usize(&mut self, i: usize) {
}
/// Write a single `i8` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_i8
(
&
mut
self
,
i
:
i8
)
{
self
.write_u8
(
i
as
u8
)
}
/// Write a single `i16` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_i16
(
&
mut
self
,
i
:
i16
)
{
self
.write_u16
(
i
as
u16
)
}
/// Write a single `i32` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_i32
(
&
mut
self
,
i
:
i32
)
{
self
.write_u32
(
i
as
u32
)
}
/// Write a single `i64` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_i64
(
&
mut
self
,
i
:
i64
)
{
self
.write_u64
(
i
as
u64
)
}
/// Write a single `isize` into this hasher.
#[cfg(not(stage0))]
#[inline]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
fn
write_isize
(
&
mut
self
,
i
:
isize
)
{
self
.write_usize
(
i
as
usize
)
}
}
/// A common bound on the `Hasher` parameter to `Hash` implementations in order
/// to generically hash an aggregate.
#[unstable(feature
=
"hash"
,
reason
=
"this trait will likely be replaced by io::Writer"
)]
#[allow(missing_docs)]
#[cfg(stage0)]
pub
trait
Writer
{
fn
write
(
&
mut
self
,
bytes
:
&
[
u8
]);
}
/// Hash a value with the default SipHasher algorithm (two initial keys of 0).
///
/// The specified value will be hashed with this hasher and then the resulting
/// hash will be returned.
#[cfg(stage0)]
pub
fn
hash
<
T
:
Hash
<
H
>
,
H
:
Hasher
+
Default
>
(
value
:
&
T
)
->
H
::
Output
{
let
mut
h
:
H
=
Default
::
default
();
value
.hash
(
&
mut
h
);
h
.finish
()
}
/// Hash a value with the default SipHasher algorithm (two initial keys of 0).
///
/// The specified value will be hashed with this hasher and then the resulting
/// hash will be returned.
#[cfg(not(stage0))]
#[unstable(feature
=
"hash"
,
reason
=
"module was recently redesigned"
)]
pub
fn
hash
<
T
:
Hash
,
H
:
Hasher
+
Default
>
(
value
:
&
T
)
->
u64
{
let
mut
h
:
H
=
Default
::
default
();
...
...
@@ -227,145 +167,6 @@ pub fn hash<T: Hash, H: Hasher + Default>(value: &T) -> u64 {
//////////////////////////////////////////////////////////////////////////////
#[cfg(stage0)]
mod
impls
{
use
prelude
::
*
;
use
mem
;
use
num
::
Int
;
use
super
::
*
;
macro_rules!
impl_hash
{
(
$ty:ident
,
$uty:ident
)
=>
{
impl
<
S
:
Writer
+
Hasher
>
Hash
<
S
>
for
$ty
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
let
a
:
[
u8
;
::
$ty
::
BYTES
]
=
unsafe
{
mem
::
transmute
(
*
self
)
};
state
.write
(
&
a
)
}
}
}
}
impl_hash!
{
u8
,
u8
}
impl_hash!
{
u16
,
u16
}
impl_hash!
{
u32
,
u32
}
impl_hash!
{
u64
,
u64
}
impl_hash!
{
uint
,
uint
}
impl_hash!
{
i8
,
u8
}
impl_hash!
{
i16
,
u16
}
impl_hash!
{
i32
,
u32
}
impl_hash!
{
i64
,
u64
}
impl_hash!
{
int
,
uint
}
impl
<
S
:
Writer
+
Hasher
>
Hash
<
S
>
for
bool
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
(
*
self
as
u8
)
.hash
(
state
);
}
}
impl
<
S
:
Writer
+
Hasher
>
Hash
<
S
>
for
char
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
(
*
self
as
u32
)
.hash
(
state
);
}
}
impl
<
S
:
Writer
+
Hasher
>
Hash
<
S
>
for
str
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
state
.write
(
self
.as_bytes
());
0xffu8
.hash
(
state
)
}
}
macro_rules!
impl_hash_tuple
{
()
=>
(
impl
<
S
:
Hasher
>
Hash
<
S
>
for
()
{
#[inline]
fn
hash
(
&
self
,
_
state
:
&
mut
S
)
{}
}
);
(
$
(
$name:ident
)
+
)
=>
(
impl
<
S
:
Hasher
,
$
(
$name
:
Hash
<
S
>
),
*>
Hash
<
S
>
for
(
$
(
$name
,)
*
)
{
#[inline]
#[allow(non_snake_case)]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
match
*
self
{
(
$
(
ref
$name
,)
*
)
=>
{
$
(
$name
.hash
(
state
);
)
*
}
}
}
}
);
}
impl_hash_tuple!
{}
impl_hash_tuple!
{
A
}
impl_hash_tuple!
{
A
B
}
impl_hash_tuple!
{
A
B
C
}
impl_hash_tuple!
{
A
B
C
D
}
impl_hash_tuple!
{
A
B
C
D
E
}
impl_hash_tuple!
{
A
B
C
D
E
F
}
impl_hash_tuple!
{
A
B
C
D
E
F
G
}
impl_hash_tuple!
{
A
B
C
D
E
F
G
H
}
impl_hash_tuple!
{
A
B
C
D
E
F
G
H
I
}
impl_hash_tuple!
{
A
B
C
D
E
F
G
H
I
J
}
impl_hash_tuple!
{
A
B
C
D
E
F
G
H
I
J
K
}
impl_hash_tuple!
{
A
B
C
D
E
F
G
H
I
J
K
L
}
impl
<
S
:
Writer
+
Hasher
,
T
:
Hash
<
S
>>
Hash
<
S
>
for
[
T
]
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
self
.len
()
.hash
(
state
);
for
elt
in
self
{
elt
.hash
(
state
);
}
}
}
impl
<
'a
,
S
:
Hasher
,
T
:
?
Sized
+
Hash
<
S
>>
Hash
<
S
>
for
&
'a
T
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
(
**
self
)
.hash
(
state
);
}
}
impl
<
'a
,
S
:
Hasher
,
T
:
?
Sized
+
Hash
<
S
>>
Hash
<
S
>
for
&
'a
mut
T
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
(
**
self
)
.hash
(
state
);
}
}
impl
<
S
:
Writer
+
Hasher
,
T
>
Hash
<
S
>
for
*
const
T
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
// NB: raw-pointer Hash does _not_ dereference
// to the target; it just gives you the pointer-bytes.
(
*
self
as
uint
)
.hash
(
state
);
}
}
impl
<
S
:
Writer
+
Hasher
,
T
>
Hash
<
S
>
for
*
mut
T
{
#[inline]
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
// NB: raw-pointer Hash does _not_ dereference
// to the target; it just gives you the pointer-bytes.
(
*
self
as
uint
)
.hash
(
state
);
}
}
}
#[cfg(not(stage0))]
mod
impls
{
use
prelude
::
*
;
...
...
src/libcore/hash/sip.rs
浏览文件 @
686648d1
...
...
@@ -16,8 +16,6 @@
use
default
::
Default
;
use
super
::
Hasher
;
#[cfg(stage0)]
use
super
::
Writer
;
/// An implementation of SipHash 2-4.
///
...
...
@@ -175,26 +173,9 @@ fn write(&mut self, msg: &[u8]) {
}
}
#[cfg(stage0)]
impl
Writer
for
SipHasher
{
#[inline]
fn
write
(
&
mut
self
,
msg
:
&
[
u8
])
{
self
.write
(
msg
)
}
}
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
Hasher
for
SipHasher
{
#[cfg(stage0)]
type
Output
=
u64
;
#[cfg(stage0)]
fn
reset
(
&
mut
self
)
{
self
.reset
();
}
#[inline]
#[cfg(not(stage0))]
fn
write
(
&
mut
self
,
msg
:
&
[
u8
])
{
self
.write
(
msg
)
}
...
...
src/libcore/marker.rs
浏览文件 @
686648d1
...
...
@@ -31,20 +31,10 @@
use
hash
::
Hash
;
use
hash
::
Hasher
;
/// Types able to be transferred across thread boundaries.
#[unstable(feature
=
"core"
,
reason
=
"will be overhauled with new lifetime rules; see RFC 458"
)]
#[lang=
"send"
]
#[rustc_on_unimplemented
=
"`{Self}` cannot be sent between threads safely"
]
#[cfg(stage0)]
pub
unsafe
trait
Send
:
'static
{
// empty.
}
/// Types able to be transferred across thread boundaries.
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[lang=
"send"
]
#[rustc_on_unimplemented
=
"`{Self}` cannot be sent between threads safely"
]
#[cfg(not(stage0))]
pub
unsafe
trait
Send
:
MarkerTrait
{
// empty.
}
...
...
@@ -233,13 +223,6 @@ pub unsafe trait Sync : MarkerTrait {
macro_rules!
impls
{
(
$t
:
ident
)
=>
(
#[cfg(stage0)]
impl
<
T
:
?
Sized
,
S
:
Hasher
>
Hash
<
S
>
for
$t
<
T
>
{
#[inline]
fn
hash
(
&
self
,
_
:
&
mut
S
)
{
}
}
#[cfg(not(stage0))]
impl
<
T
:
?
Sized
>
Hash
for
$t
<
T
>
{
#[inline]
fn
hash
<
H
:
Hasher
>
(
&
self
,
_
:
&
mut
H
)
{
...
...
@@ -348,14 +331,6 @@ impl<T:?Sized> MarkerTrait for T { }
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
PhantomFn
<
A
:
?
Sized
,
R
:
?
Sized
=
()
>
{
}
#[cfg(stage0)]
// built into the trait matching system after stage0
impl
<
A
:
?
Sized
,
R
:
?
Sized
,
U
:
?
Sized
>
PhantomFn
<
A
,
R
>
for
U
{
}
/// Specific to stage0. You should not be seeing these docs!
#[cfg(stage0)]
#[lang=
"covariant_type"
]
// only relevant to stage0
pub
struct
PhantomData
<
T
:
?
Sized
>
;
/// `PhantomData` is a way to tell the compiler about fake fields.
/// Phantom data is required whenever type parameters are not used.
/// The idea is that if the compiler encounters a `PhantomData<T>`
...
...
@@ -374,14 +349,12 @@ impl<A:?Sized, R:?Sized, U:?Sized> PhantomFn<A,R> for U { }
/// here! For now, please see [RFC 738][738] for more information.
///
/// [738]: https://github.com/rust-lang/rfcs/blob/master/text/0738-variance.md
#[cfg(not(stage0))]
#[lang=
"phantom_data"
]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
PhantomData
<
T
:
?
Sized
>
;
impls!
{
PhantomData
}
#[cfg(not(stage0))]
mod
impls
{
use
super
::{
Send
,
Sync
,
Sized
};
...
...
@@ -417,7 +390,6 @@ unsafe impl<'a, T: Send + ?Sized> Send for &'a mut T {}
#[unstable(feature
=
"core"
,
reason
=
"deprecated"
)]
#[deprecated(since
=
"1.0.0"
,
reason
=
"Replace with `PhantomData<T>`"
)]
#[lang=
"covariant_type"
]
#[cfg(not(stage0))]
pub
struct
CovariantType
<
T
>
;
/// Old-style marker trait. Deprecated.
...
...
src/librustc/lint/mod.rs
浏览文件 @
686648d1
...
...
@@ -185,14 +185,6 @@ fn eq(&self, other: &LintId) -> bool {
impl
Eq
for
LintId
{
}
#[cfg(stage0)]
impl
<
S
:
hash
::
Writer
+
hash
::
Hasher
>
hash
::
Hash
<
S
>
for
LintId
{
fn
hash
(
&
self
,
state
:
&
mut
S
)
{
let
ptr
=
self
.lint
as
*
const
Lint
;
ptr
.hash
(
state
);
}
}
#[cfg(not(stage0))]
impl
hash
::
Hash
for
LintId
{
fn
hash
<
H
:
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
let
ptr
=
self
.lint
as
*
const
Lint
;
...
...
src/librustc/metadata/encoder.rs
浏览文件 @
686648d1
...
...
@@ -1588,48 +1588,6 @@ fn encode_info_for_items(ecx: &EncodeContext,
// Path and definition ID indexing
#[cfg(stage0)]
fn
encode_index
<
T
,
F
>
(
rbml_w
:
&
mut
Encoder
,
index
:
Vec
<
entry
<
T
>>
,
mut
write_fn
:
F
)
where
F
:
FnMut
(
&
mut
SeekableMemWriter
,
&
T
),
T
:
Hash
<
SipHasher
>
,
{
let
mut
buckets
:
Vec
<
Vec
<
entry
<
T
>>>
=
(
0
..
256u16
)
.map
(|
_
|
Vec
::
new
())
.collect
();
for
elt
in
index
{
let
mut
s
=
SipHasher
::
new
();
elt
.val
.hash
(
&
mut
s
);
let
h
=
s
.finish
()
as
uint
;
(
&
mut
buckets
[
h
%
256
])
.push
(
elt
);
}
rbml_w
.start_tag
(
tag_index
);
let
mut
bucket_locs
=
Vec
::
new
();
rbml_w
.start_tag
(
tag_index_buckets
);
for
bucket
in
&
buckets
{
bucket_locs
.push
(
rbml_w
.writer
.tell
()
.unwrap
());
rbml_w
.start_tag
(
tag_index_buckets_bucket
);
for
elt
in
bucket
{
rbml_w
.start_tag
(
tag_index_buckets_bucket_elt
);
assert
!
(
elt
.pos
<
0xffff_ffff
);
{
let
wr
:
&
mut
SeekableMemWriter
=
rbml_w
.writer
;
wr
.write_be_u32
(
elt
.pos
as
u32
);
}
write_fn
(
rbml_w
.writer
,
&
elt
.val
);
rbml_w
.end_tag
();
}
rbml_w
.end_tag
();
}
rbml_w
.end_tag
();
rbml_w
.start_tag
(
tag_index_table
);
for
pos
in
&
bucket_locs
{
assert
!
(
*
pos
<
0xffff_ffff
);
let
wr
:
&
mut
SeekableMemWriter
=
rbml_w
.writer
;
wr
.write_be_u32
(
*
pos
as
u32
);
}
rbml_w
.end_tag
();
rbml_w
.end_tag
();
}
#[cfg(not(stage0))]
fn
encode_index
<
T
,
F
>
(
rbml_w
:
&
mut
Encoder
,
index
:
Vec
<
entry
<
T
>>
,
mut
write_fn
:
F
)
where
F
:
FnMut
(
&
mut
SeekableMemWriter
,
&
T
),
T
:
Hash
,
...
...
src/librustc/middle/ty.rs
浏览文件 @
686648d1
...
...
@@ -73,7 +73,6 @@
use
std
::
cmp
;
use
std
::
fmt
;
use
std
::
hash
::{
Hash
,
SipHasher
,
Hasher
};
#[cfg(stage0)]
use
std
::
hash
::
Writer
;
use
std
::
mem
;
use
std
::
ops
;
use
std
::
rc
::
Rc
;
...
...
@@ -959,13 +958,6 @@ fn eq(&self, other: &TyS<'tcx>) -> bool {
}
impl
<
'tcx
>
Eq
for
TyS
<
'tcx
>
{}
#[cfg(stage0)]
impl
<
'tcx
,
S
:
Writer
+
Hasher
>
Hash
<
S
>
for
TyS
<
'tcx
>
{
fn
hash
(
&
self
,
s
:
&
mut
S
)
{
(
self
as
*
const
_
)
.hash
(
s
)
}
}
#[cfg(not(stage0))]
impl
<
'tcx
>
Hash
for
TyS
<
'tcx
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
s
:
&
mut
H
)
{
(
self
as
*
const
_
)
.hash
(
s
)
...
...
@@ -988,13 +980,6 @@ fn eq(&self, other: &InternedTy<'tcx>) -> bool {
impl
<
'tcx
>
Eq
for
InternedTy
<
'tcx
>
{}
#[cfg(stage0)]
impl
<
'tcx
,
S
:
Writer
+
Hasher
>
Hash
<
S
>
for
InternedTy
<
'tcx
>
{
fn
hash
(
&
self
,
s
:
&
mut
S
)
{
self
.ty.sty
.hash
(
s
)
}
}
#[cfg(not(stage0))]
impl
<
'tcx
>
Hash
for
InternedTy
<
'tcx
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
s
:
&
mut
H
)
{
self
.ty.sty
.hash
(
s
)
...
...
src/librustc/util/common.rs
浏览文件 @
686648d1
...
...
@@ -14,7 +14,6 @@
use
std
::
collections
::
HashMap
;
use
std
::
fmt
::
Debug
;
use
std
::
hash
::
Hash
;
#[cfg(stage0)]
use
std
::
hash
::
Hasher
;
use
std
::
iter
::
repeat
;
use
std
::
time
::
Duration
;
use
std
::
collections
::
hash_state
::
HashState
;
...
...
@@ -139,57 +138,13 @@ pub fn block_query<P>(b: &ast::Block, p: P) -> bool where P: FnMut(&ast::Expr) -
/// K: Eq + Hash<S>, V, S, H: Hasher<S>
///
/// Determines whether there exists a path from `source` to `destination`. The graph is defined by
/// the `edges_map`, which maps from a node `S` to a list of its adjacent nodes `T`.
/// Determines whether there exists a path from `source` to `destination`. The
/// graph is defined by the `edges_map`, which maps from a node `S` to a list of
/// its adjacent nodes `T`.
///
/// Efficiency note: This is implemented in an inefficient way because it is typically invoked on
/// very small graphs. If the graphs become larger, a more efficient graph representation and
/// algorithm would probably be advised.
#[cfg(stage0)]
pub
fn
can_reach
<
T
,
S
>
(
edges_map
:
&
HashMap
<
T
,
Vec
<
T
>
,
S
>
,
source
:
T
,
destination
:
T
)
->
bool
where
S
:
HashState
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
,
T
:
Hash
<<
S
as
HashState
>
::
Hasher
>
+
Eq
+
Clone
,
{
if
source
==
destination
{
return
true
;
}
// Do a little breadth-first-search here. The `queue` list
// doubles as a way to detect if we've seen a particular FR
// before. Note that we expect this graph to be an *extremely
// shallow* tree.
let
mut
queue
=
vec!
(
source
);
let
mut
i
=
0
;
while
i
<
queue
.len
()
{
match
edges_map
.get
(
&
queue
[
i
])
{
Some
(
edges
)
=>
{
for
target
in
edges
{
if
*
target
==
destination
{
return
true
;
}
if
!
queue
.iter
()
.any
(|
x
|
x
==
target
)
{
queue
.push
((
*
target
)
.clone
());
}
}
}
None
=>
{}
}
i
+=
1
;
}
return
false
;
}
/// K: Eq + Hash<S>, V, S, H: Hasher<S>
///
/// Determines whether there exists a path from `source` to `destination`. The graph is defined by
/// the `edges_map`, which maps from a node `S` to a list of its adjacent nodes `T`.
///
/// Efficiency note: This is implemented in an inefficient way because it is typically invoked on
/// very small graphs. If the graphs become larger, a more efficient graph representation and
/// algorithm would probably be advised.
#[cfg(not(stage0))]
/// Efficiency note: This is implemented in an inefficient way because it is
/// typically invoked on very small graphs. If the graphs become larger, a more
/// efficient graph representation and algorithm would probably be advised.
pub
fn
can_reach
<
T
,
S
>
(
edges_map
:
&
HashMap
<
T
,
Vec
<
T
>
,
S
>
,
source
:
T
,
destination
:
T
)
->
bool
where
S
:
HashState
,
T
:
Hash
+
Eq
+
Clone
,
...
...
@@ -250,52 +205,6 @@ pub fn can_reach<T, S>(edges_map: &HashMap<T, Vec<T>, S>, source: T,
/// }
/// ```
#[inline(always)]
#[cfg(stage0)]
pub
fn
memoized
<
T
,
U
,
S
,
F
>
(
cache
:
&
RefCell
<
HashMap
<
T
,
U
,
S
>>
,
arg
:
T
,
f
:
F
)
->
U
where
T
:
Clone
+
Hash
<<
S
as
HashState
>
::
Hasher
>
+
Eq
,
U
:
Clone
,
S
:
HashState
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
,
F
:
FnOnce
(
T
)
->
U
,
{
let
key
=
arg
.clone
();
let
result
=
cache
.borrow
()
.get
(
&
key
)
.cloned
();
match
result
{
Some
(
result
)
=>
result
,
None
=>
{
let
result
=
f
(
arg
);
cache
.borrow_mut
()
.insert
(
key
,
result
.clone
());
result
}
}
}
/// Memoizes a one-argument closure using the given RefCell containing
/// a type implementing MutableMap to serve as a cache.
///
/// In the future the signature of this function is expected to be:
/// ```
/// pub fn memoized<T: Clone, U: Clone, M: MutableMap<T, U>>(
/// cache: &RefCell<M>,
/// f: &|T| -> U
/// ) -> impl |T| -> U {
/// ```
/// but currently it is not possible.
///
/// # Example
/// ```
/// struct Context {
/// cache: RefCell<HashMap<uint, uint>>
/// }
///
/// fn factorial(ctxt: &Context, n: uint) -> uint {
/// memoized(&ctxt.cache, n, |n| match n {
/// 0 | 1 => n,
/// _ => factorial(ctxt, n - 2) + factorial(ctxt, n - 1)
/// })
/// }
/// ```
#[inline(always)]
#[cfg(not(stage0))]
pub
fn
memoized
<
T
,
U
,
S
,
F
>
(
cache
:
&
RefCell
<
HashMap
<
T
,
U
,
S
>>
,
arg
:
T
,
f
:
F
)
->
U
where
T
:
Clone
+
Hash
+
Eq
,
U
:
Clone
,
...
...
src/librustc/util/nodemap.rs
浏览文件 @
686648d1
...
...
@@ -16,7 +16,6 @@
use
std
::
collections
::{
HashMap
,
HashSet
};
use
std
::
default
::
Default
;
use
std
::
hash
::{
Hasher
,
Hash
};
#[cfg(stage0)]
use
std
::
hash
::
Writer
;
use
syntax
::
ast
;
pub
type
FnvHashMap
<
K
,
V
>
=
HashMap
<
K
,
V
,
DefaultState
<
FnvHasher
>>
;
...
...
@@ -28,19 +27,9 @@
pub
type
NodeSet
=
FnvHashSet
<
ast
::
NodeId
>
;
pub
type
DefIdSet
=
FnvHashSet
<
ast
::
DefId
>
;
#[cfg(stage0)]
pub
fn
FnvHashMap
<
K
:
Hash
<
FnvHasher
>
+
Eq
,
V
>
()
->
FnvHashMap
<
K
,
V
>
{
Default
::
default
()
}
#[cfg(stage0)]
pub
fn
FnvHashSet
<
V
:
Hash
<
FnvHasher
>
+
Eq
>
()
->
FnvHashSet
<
V
>
{
Default
::
default
()
}
#[cfg(not(stage0))]
pub
fn
FnvHashMap
<
K
:
Hash
+
Eq
,
V
>
()
->
FnvHashMap
<
K
,
V
>
{
Default
::
default
()
}
#[cfg(not(stage0))]
pub
fn
FnvHashSet
<
V
:
Hash
+
Eq
>
()
->
FnvHashSet
<
V
>
{
Default
::
default
()
}
...
...
@@ -63,26 +52,6 @@ impl Default for FnvHasher {
fn
default
()
->
FnvHasher
{
FnvHasher
(
0xcbf29ce484222325
)
}
}
#[cfg(stage0)]
impl
Hasher
for
FnvHasher
{
type
Output
=
u64
;
fn
reset
(
&
mut
self
)
{
*
self
=
Default
::
default
();
}
fn
finish
(
&
self
)
->
u64
{
self
.0
}
}
#[cfg(stage0)]
impl
Writer
for
FnvHasher
{
fn
write
(
&
mut
self
,
bytes
:
&
[
u8
])
{
let
FnvHasher
(
mut
hash
)
=
*
self
;
for
byte
in
bytes
{
hash
=
hash
^
(
*
byte
as
u64
);
hash
=
hash
*
0x100000001b3
;
}
*
self
=
FnvHasher
(
hash
);
}
}
#[cfg(not(stage0))]
impl
Hasher
for
FnvHasher
{
fn
write
(
&
mut
self
,
bytes
:
&
[
u8
])
{
let
FnvHasher
(
mut
hash
)
=
*
self
;
...
...
src/librustc/util/ppaux.rs
浏览文件 @
686648d1
...
...
@@ -29,7 +29,6 @@
use
std
::
collections
::
HashMap
;
use
std
::
collections
::
hash_state
::
HashState
;
use
std
::
hash
::
Hash
;
#[cfg(stage0)]
use
std
::
hash
::
Hasher
;
use
std
::
rc
::
Rc
;
use
syntax
::
abi
;
use
syntax
::
ast_map
;
...
...
@@ -1434,23 +1433,6 @@ fn repr(&self, tcx: &ctxt<'tcx>) -> String {
}
}
#[cfg(stage0)]
impl
<
'tcx
,
S
,
K
,
V
>
Repr
<
'tcx
>
for
HashMap
<
K
,
V
,
S
>
where
K
:
Hash
<<
S
as
HashState
>
::
Hasher
>
+
Eq
+
Repr
<
'tcx
>
,
V
:
Repr
<
'tcx
>
,
S
:
HashState
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
,
{
fn
repr
(
&
self
,
tcx
:
&
ctxt
<
'tcx
>
)
->
String
{
format!
(
"HashMap({})"
,
self
.iter
()
.map
(|(
k
,
v
)|
format!
(
"{} => {}"
,
k
.repr
(
tcx
),
v
.repr
(
tcx
)))
.collect
::
<
Vec
<
String
>>
()
.connect
(
", "
))
}
}
#[cfg(not(stage0))]
impl
<
'tcx
,
S
,
K
,
V
>
Repr
<
'tcx
>
for
HashMap
<
K
,
V
,
S
>
where
K
:
Hash
+
Eq
+
Repr
<
'tcx
>
,
V
:
Repr
<
'tcx
>
,
...
...
src/libserialize/collection_impls.rs
浏览文件 @
686648d1
...
...
@@ -13,7 +13,6 @@
use
std
::
usize
;
use
std
::
default
::
Default
;
use
std
::
hash
::
Hash
;
#[cfg(stage0)]
use
std
::
hash
::
Hasher
;
use
std
::
collections
::
hash_state
::
HashState
;
use
{
Decodable
,
Encodable
,
Decoder
,
Encoder
};
...
...
@@ -158,26 +157,6 @@ fn decode<D: Decoder>(d: &mut D) -> Result<EnumSet<T>, D::Error> {
}
}
#[cfg(stage0)]
impl
<
K
,
V
,
S
>
Encodable
for
HashMap
<
K
,
V
,
S
>
where
K
:
Encodable
+
Hash
<
<
S
as
HashState
>
::
Hasher
>
+
Eq
,
V
:
Encodable
,
S
:
HashState
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
{
fn
encode
<
E
:
Encoder
>
(
&
self
,
e
:
&
mut
E
)
->
Result
<
(),
E
::
Error
>
{
e
.emit_map
(
self
.len
(),
|
e
|
{
let
mut
i
=
0
;
for
(
key
,
val
)
in
self
{
try!
(
e
.emit_map_elt_key
(
i
,
|
e
|
key
.encode
(
e
)));
try!
(
e
.emit_map_elt_val
(
i
,
|
e
|
val
.encode
(
e
)));
i
+=
1
;
}
Ok
(())
})
}
}
#[cfg(not(stage0))]
impl
<
K
,
V
,
S
>
Encodable
for
HashMap
<
K
,
V
,
S
>
where
K
:
Encodable
+
Hash
+
Eq
,
V
:
Encodable
,
...
...
@@ -196,27 +175,6 @@ fn encode<E: Encoder>(&self, e: &mut E) -> Result<(), E::Error> {
}
}
#[cfg(stage0)]
impl
<
K
,
V
,
S
>
Decodable
for
HashMap
<
K
,
V
,
S
>
where
K
:
Decodable
+
Hash
<
<
S
as
HashState
>
::
Hasher
>
+
Eq
,
V
:
Decodable
,
S
:
HashState
+
Default
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
{
fn
decode
<
D
:
Decoder
>
(
d
:
&
mut
D
)
->
Result
<
HashMap
<
K
,
V
,
S
>
,
D
::
Error
>
{
d
.read_map
(|
d
,
len
|
{
let
state
=
Default
::
default
();
let
mut
map
=
HashMap
::
with_capacity_and_hash_state
(
len
,
state
);
for
i
in
0
..
len
{
let
key
=
try!
(
d
.read_map_elt_key
(
i
,
|
d
|
Decodable
::
decode
(
d
)));
let
val
=
try!
(
d
.read_map_elt_val
(
i
,
|
d
|
Decodable
::
decode
(
d
)));
map
.insert
(
key
,
val
);
}
Ok
(
map
)
})
}
}
#[cfg(not(stage0))]
impl
<
K
,
V
,
S
>
Decodable
for
HashMap
<
K
,
V
,
S
>
where
K
:
Decodable
+
Hash
+
Eq
,
V
:
Decodable
,
...
...
@@ -236,24 +194,6 @@ fn decode<D: Decoder>(d: &mut D) -> Result<HashMap<K, V, S>, D::Error> {
}
}
#[cfg(stage0)]
impl
<
T
,
S
>
Encodable
for
HashSet
<
T
,
S
>
where
T
:
Encodable
+
Hash
<
<
S
as
HashState
>
::
Hasher
>
+
Eq
,
S
:
HashState
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
{
fn
encode
<
E
:
Encoder
>
(
&
self
,
s
:
&
mut
E
)
->
Result
<
(),
E
::
Error
>
{
s
.emit_seq
(
self
.len
(),
|
s
|
{
let
mut
i
=
0
;
for
e
in
self
{
try!
(
s
.emit_seq_elt
(
i
,
|
s
|
e
.encode
(
s
)));
i
+=
1
;
}
Ok
(())
})
}
}
#[cfg(not(stage0))]
impl
<
T
,
S
>
Encodable
for
HashSet
<
T
,
S
>
where
T
:
Encodable
+
Hash
+
Eq
,
S
:
HashState
,
...
...
@@ -270,24 +210,6 @@ fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error> {
}
}
#[cfg(stage0)]
impl
<
T
,
S
>
Decodable
for
HashSet
<
T
,
S
>
where
T
:
Decodable
+
Hash
<
<
S
as
HashState
>
::
Hasher
>
+
Eq
,
S
:
HashState
+
Default
,
<
S
as
HashState
>
::
Hasher
:
Hasher
<
Output
=
u64
>
{
fn
decode
<
D
:
Decoder
>
(
d
:
&
mut
D
)
->
Result
<
HashSet
<
T
,
S
>
,
D
::
Error
>
{
d
.read_seq
(|
d
,
len
|
{
let
state
=
Default
::
default
();
let
mut
set
=
HashSet
::
with_capacity_and_hash_state
(
len
,
state
);
for
i
in
0
..
len
{
set
.insert
(
try!
(
d
.read_seq_elt
(
i
,
|
d
|
Decodable
::
decode
(
d
))));
}
Ok
(
set
)
})
}
}
#[cfg(not(stage0))]
impl
<
T
,
S
>
Decodable
for
HashSet
<
T
,
S
>
where
T
:
Decodable
+
Hash
+
Eq
,
S
:
HashState
+
Default
,
...
...
src/libstd/collections/hash/map_stage0.rs
已删除
100644 → 0
浏览文件 @
5d7b216f
此差异已折叠。
点击以展开。
src/libstd/collections/hash/mod.rs
浏览文件 @
686648d1
...
...
@@ -12,14 +12,6 @@
mod
bench
;
mod
table
;
#[cfg(stage0)]
#[path
=
"map_stage0.rs"
]
pub
mod
map
;
#[cfg(not(stage0))]
pub
mod
map
;
#[cfg(stage0)]
#[path
=
"set_stage0.rs"
]
pub
mod
set
;
#[cfg(not(stage0))]
pub
mod
set
;
pub
mod
state
;
src/libstd/collections/hash/set_stage0.rs
已删除
100644 → 0
浏览文件 @
5d7b216f
此差异已折叠。
点击以展开。
src/libstd/collections/hash/table.rs
浏览文件 @
686648d1
...
...
@@ -143,25 +143,6 @@ pub fn inspect(&self) -> u64 { self.hash }
/// We need to remove hashes of 0. That's reserved for empty buckets.
/// This function wraps up `hash_keyed` to be the only way outside this
/// module to generate a SafeHash.
#[cfg(stage0)]
pub
fn
make_hash
<
T
:
?
Sized
,
S
,
H
>
(
hash_state
:
&
S
,
t
:
&
T
)
->
SafeHash
where
T
:
Hash
<
H
>
,
S
:
HashState
<
Hasher
=
H
>
,
H
:
Hasher
<
Output
=
u64
>
{
let
mut
state
=
hash_state
.hasher
();
t
.hash
(
&
mut
state
);
// We need to avoid 0u64 in order to prevent collisions with
// EMPTY_HASH. We can maintain our precious uniform distribution
// of initial indexes by unconditionally setting the MSB,
// effectively reducing 64-bits hashes to 63 bits.
SafeHash
{
hash
:
0x8000_0000_0000_0000
|
state
.finish
()
}
}
/// We need to remove hashes of 0. That's reserved for empty buckets.
/// This function wraps up `hash_keyed` to be the only way outside this
/// module to generate a SafeHash.
#[cfg(not(stage0))]
pub
fn
make_hash
<
T
:
?
Sized
,
S
>
(
hash_state
:
&
S
,
t
:
&
T
)
->
SafeHash
where
T
:
Hash
,
S
:
HashState
{
...
...
src/libstd/ffi/os_str.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/net/addr.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/net/ip.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/old_io/process.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/old_path/posix.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/old_path/windows.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/sys/common/wtf8.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/sys/unix/process.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/sys/windows/process.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libstd/thunk.rs
浏览文件 @
686648d1
...
...
@@ -17,9 +17,6 @@
use
core
::
ops
::
FnOnce
;
pub
struct
Thunk
<
'a
,
A
=
(),
R
=
()
>
{
#[cfg(stage0)]
invoke
:
Box
<
Invoke
<
A
,
R
>+
Send
>
,
#[cfg(not(stage0))]
invoke
:
Box
<
Invoke
<
A
,
R
>+
Send
+
'a
>
,
}
...
...
src/libsyntax/ptr.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/libsyntax/util/interner.rs
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
src/snapshots.txt
浏览文件 @
686648d1
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录