Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
88c515da
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,发现更多精彩内容 >>
未验证
提交
88c515da
编写于
6月 25, 2019
作者:
J
Jeremy Stucki
提交者:
Jeremy Stucki
7月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert changes to the standard library
Moved to its own PR
上级
edcde702
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
25 addition
and
25 deletion
+25
-25
src/liballoc/collections/btree/map.rs
src/liballoc/collections/btree/map.rs
+4
-4
src/liballoc/collections/btree/node.rs
src/liballoc/collections/btree/node.rs
+1
-1
src/liballoc/string.rs
src/liballoc/string.rs
+1
-1
src/libcore/marker.rs
src/libcore/marker.rs
+1
-1
src/libcore/ops/index.rs
src/libcore/ops/index.rs
+2
-2
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+5
-5
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+1
-1
src/librustdoc/html/toc.rs
src/librustdoc/html/toc.rs
+1
-1
src/librustdoc/markdown.rs
src/librustdoc/markdown.rs
+1
-1
src/libserialize/json.rs
src/libserialize/json.rs
+2
-2
src/libstd/sync/mpsc/sync.rs
src/libstd/sync/mpsc/sync.rs
+1
-1
src/libstd/sys/redox/ext/net.rs
src/libstd/sys/redox/ext/net.rs
+1
-1
src/libstd/sys/unix/ext/net.rs
src/libstd/sys/unix/ext/net.rs
+1
-1
src/libstd/sys/windows/mod.rs
src/libstd/sys/windows/mod.rs
+1
-1
src/libstd/sys/windows/path.rs
src/libstd/sys/windows/path.rs
+1
-1
src/libstd/sys_common/io.rs
src/libstd/sys_common/io.rs
+1
-1
未找到文件。
src/liballoc/collections/btree/map.rs
浏览文件 @
88c515da
...
...
@@ -2004,7 +2004,7 @@ pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
/// assert_eq!(keys, [1, 2]);
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
fn
keys
(
&
self
)
->
Keys
<
'_
,
K
,
V
>
{
pub
fn
keys
<
'a
>
(
&
'a
self
)
->
Keys
<
'a
,
K
,
V
>
{
Keys
{
inner
:
self
.iter
()
}
}
...
...
@@ -2025,7 +2025,7 @@ pub fn keys(&self) -> Keys<'_, K, V> {
/// assert_eq!(values, ["hello", "goodbye"]);
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
fn
values
(
&
self
)
->
Values
<
'_
,
K
,
V
>
{
pub
fn
values
<
'a
>
(
&
'a
self
)
->
Values
<
'a
,
K
,
V
>
{
Values
{
inner
:
self
.iter
()
}
}
...
...
@@ -2529,8 +2529,8 @@ enum UnderflowResult<'a, K, V> {
Stole
(
NodeRef
<
marker
::
Mut
<
'a
>
,
K
,
V
,
marker
::
Internal
>
),
}
fn
handle_underfull_node
<
K
,
V
>
(
node
:
NodeRef
<
marker
::
Mut
<
'_
>
,
K
,
V
,
marker
::
LeafOrInternal
>
)
->
UnderflowResult
<
'_
,
K
,
V
>
{
fn
handle_underfull_node
<
'a
,
K
,
V
>
(
node
:
NodeRef
<
marker
::
Mut
<
'a
>
,
K
,
V
,
marker
::
LeafOrInternal
>
)
->
UnderflowResult
<
'a
,
K
,
V
>
{
let
parent
=
if
let
Ok
(
parent
)
=
node
.ascend
()
{
parent
}
else
{
...
...
src/liballoc/collections/btree/node.rs
浏览文件 @
88c515da
...
...
@@ -394,7 +394,7 @@ pub fn forget_type(self) -> NodeRef<BorrowType, K, V, marker::LeafOrInternal> {
}
/// Temporarily takes out another, immutable reference to the same node.
fn
reborrow
(
&
self
)
->
NodeRef
<
marker
::
Immut
<
'_
>
,
K
,
V
,
Type
>
{
fn
reborrow
<
'a
>
(
&
'a
self
)
->
NodeRef
<
marker
::
Immut
<
'a
>
,
K
,
V
,
Type
>
{
NodeRef
{
height
:
self
.height
,
node
:
self
.node
,
...
...
src/liballoc/string.rs
浏览文件 @
88c515da
...
...
@@ -552,7 +552,7 @@ pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> {
/// assert_eq!("Hello �World", output);
/// ```
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
fn
from_utf8_lossy
(
v
:
&
[
u8
])
->
Cow
<
'_
,
str
>
{
pub
fn
from_utf8_lossy
<
'a
>
(
v
:
&
'a
[
u8
])
->
Cow
<
'a
,
str
>
{
let
mut
iter
=
lossy
::
Utf8Lossy
::
from_bytes
(
v
)
.chunks
();
let
(
first_valid
,
first_broken
)
=
if
let
Some
(
chunk
)
=
iter
.next
()
{
...
...
src/libcore/marker.rs
浏览文件 @
88c515da
...
...
@@ -498,7 +498,7 @@ fn default() -> $t<T> {
/// # end: *const T,
/// # phantom: PhantomData<&'a T>,
/// # }
/// fn borrow_vec<
T>(vec: &Vec<T>) -> Slice<'_
, T> {
/// fn borrow_vec<
'a, T>(vec: &'a Vec<T>) -> Slice<'a
, T> {
/// let ptr = vec.as_ptr();
/// Slice {
/// start: ptr,
...
...
src/libcore/ops/index.rs
浏览文件 @
88c515da
...
...
@@ -105,7 +105,7 @@ pub trait Index<Idx: ?Sized> {
/// impl Index<Side> for Balance {
/// type Output = Weight;
///
/// fn index
(&self, index: Side) -> &
Self::Output {
/// fn index
<'a>(&'a self, index: Side) -> &'a
Self::Output {
/// println!("Accessing {:?}-side of balance immutably", index);
/// match index {
/// Side::Left => &self.left,
...
...
@@ -115,7 +115,7 @@ pub trait Index<Idx: ?Sized> {
/// }
///
/// impl IndexMut<Side> for Balance {
/// fn index_mut
(&mut self, index: Side) -> &
mut Self::Output {
/// fn index_mut
<'a>(&'a mut self, index: Side) -> &'a
mut Self::Output {
/// println!("Accessing {:?}-side of balance mutably", index);
/// match index {
/// Side::Left => &mut self.left,
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
88c515da
...
...
@@ -392,7 +392,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
impl
Item
{
/// Finds the `doc` attribute as a NameValue and returns the corresponding
/// value found.
pub
fn
doc_value
(
&
self
)
->
Option
<&
str
>
{
pub
fn
doc_value
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
str
>
{
self
.attrs
.doc_value
()
}
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
...
...
@@ -699,11 +699,11 @@ fn size_hint(&self) -> (usize, Option<usize>) {
pub
trait
AttributesExt
{
/// Finds an attribute as List and returns the list of attributes nested inside.
fn
lists
(
&
self
,
name
:
Symbol
)
->
ListAttributesIter
<
'_
>
;
fn
lists
<
'a
>
(
&
'a
self
,
name
:
Symbol
)
->
ListAttributesIter
<
'a
>
;
}
impl
AttributesExt
for
[
ast
::
Attribute
]
{
fn
lists
(
&
self
,
name
:
Symbol
)
->
ListAttributesIter
<
'_
>
{
fn
lists
<
'a
>
(
&
'a
self
,
name
:
Symbol
)
->
ListAttributesIter
<
'a
>
{
ListAttributesIter
{
attrs
:
self
.iter
(),
current_list
:
Vec
::
new
()
.into_iter
(),
...
...
@@ -952,7 +952,7 @@ pub fn from_ast(diagnostic: &::errors::Handler,
/// Finds the `doc` attribute as a NameValue and returns the corresponding
/// value found.
pub
fn
doc_value
(
&
self
)
->
Option
<&
str
>
{
pub
fn
doc_value
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
str
>
{
self
.doc_strings
.first
()
.map
(|
s
|
s
.as_str
())
}
...
...
@@ -1037,7 +1037,7 @@ fn hash<H: Hasher>(&self, hasher: &mut H) {
}
impl
AttributesExt
for
Attributes
{
fn
lists
(
&
self
,
name
:
Symbol
)
->
ListAttributesIter
<
'_
>
{
fn
lists
<
'a
>
(
&
'a
self
,
name
:
Symbol
)
->
ListAttributesIter
<
'a
>
{
self
.other_attrs
.lists
(
name
)
}
}
...
...
src/librustdoc/html/render.rs
浏览文件 @
88c515da
...
...
@@ -2541,7 +2541,7 @@ fn full_path(cx: &Context, item: &clean::Item) -> String {
s
}
fn
shorter
(
s
:
Option
<&
str
>
)
->
String
{
fn
shorter
<
'a
>
(
s
:
Option
<&
'a
str
>
)
->
String
{
match
s
{
Some
(
s
)
=>
s
.lines
()
.skip_while
(|
s
|
s
.chars
()
.all
(|
c
|
c
.is_whitespace
()))
...
...
src/librustdoc/html/toc.rs
浏览文件 @
88c515da
...
...
@@ -119,7 +119,7 @@ fn fold_until(&mut self, level: u32) {
/// Push a level `level` heading into the appropriate place in the
/// hierarchy, returning a string containing the section number in
/// `<num>.<num>.<num>` format.
pub
fn
push
(
&
mut
self
,
level
:
u32
,
name
:
String
,
id
:
String
)
->
&
str
{
pub
fn
push
<
'a
>
(
&
'a
mut
self
,
level
:
u32
,
name
:
String
,
id
:
String
)
->
&
'a
str
{
assert
!
(
level
>=
1
);
// collapse all previous sections into their parents until we
...
...
src/librustdoc/markdown.rs
浏览文件 @
88c515da
...
...
@@ -17,7 +17,7 @@
use
crate
::
test
::{
TestOptions
,
Collector
};
/// Separate any lines at the start of the file that begin with `# ` or `%`.
fn
extract_leading_metadata
(
s
:
&
str
)
->
(
Vec
<&
str
>
,
&
str
)
{
fn
extract_leading_metadata
<
'a
>
(
s
:
&
'a
str
)
->
(
Vec
<&
'a
str
>
,
&
'a
str
)
{
let
mut
metadata
=
Vec
::
new
();
let
mut
count
=
0
;
...
...
src/libserialize/json.rs
浏览文件 @
88c515da
...
...
@@ -1031,7 +1031,7 @@ pub fn pretty(&self) -> PrettyJson<'_> {
/// If the Json value is an Object, returns the value associated with the provided key.
/// Otherwise, returns None.
pub
fn
find
(
&
self
,
key
:
&
str
)
->
Option
<&
Json
>
{
pub
fn
find
<
'a
>
(
&
'a
self
,
key
:
&
str
)
->
Option
<&
'a
Json
>
{
match
*
self
{
Json
::
Object
(
ref
map
)
=>
map
.get
(
key
),
_
=>
None
...
...
@@ -1052,7 +1052,7 @@ pub fn find_path<'a>(&'a self, keys: &[&str]) -> Option<&'a Json>{
/// If the Json value is an Object, performs a depth-first search until
/// a value associated with the provided key is found. If no value is found
/// or the Json value is not an Object, returns `None`.
pub
fn
search
(
&
self
,
key
:
&
str
)
->
Option
<&
Json
>
{
pub
fn
search
<
'a
>
(
&
'a
self
,
key
:
&
str
)
->
Option
<&
'a
Json
>
{
match
self
{
&
Json
::
Object
(
ref
map
)
=>
{
match
map
.get
(
key
)
{
...
...
src/libstd/sync/mpsc/sync.rs
浏览文件 @
88c515da
...
...
@@ -140,7 +140,7 @@ fn wait_timeout_receiver<'a, 'b, T>(lock: &'a Mutex<State<T>>,
new_guard
}
fn
abort_selection
<
T
>
(
guard
:
&
mut
MutexGuard
<
'_
,
State
<
T
>>
)
->
bool
{
fn
abort_selection
<
'a
,
T
>
(
guard
:
&
mut
MutexGuard
<
'a
,
State
<
T
>>
)
->
bool
{
match
mem
::
replace
(
&
mut
guard
.blocker
,
NoneBlocked
)
{
NoneBlocked
=>
true
,
BlockedSender
(
token
)
=>
{
...
...
src/libstd/sys/redox/ext/net.rs
浏览文件 @
88c515da
...
...
@@ -673,7 +673,7 @@ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
/// }
/// ```
#[stable(feature
=
"unix_socket_redox"
,
since
=
"1.29.0"
)]
pub
fn
incoming
(
&
self
)
->
Incoming
{
pub
fn
incoming
<
'a
>
(
&
'a
self
)
->
Incoming
<
'a
>
{
Incoming
{
listener
:
self
}
}
}
...
...
src/libstd/sys/unix/ext/net.rs
浏览文件 @
88c515da
...
...
@@ -894,7 +894,7 @@ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
/// }
/// ```
#[stable(feature
=
"unix_socket"
,
since
=
"1.10.0"
)]
pub
fn
incoming
(
&
self
)
->
Incoming
<
'_
>
{
pub
fn
incoming
<
'a
>
(
&
'a
self
)
->
Incoming
<
'a
>
{
Incoming
{
listener
:
self
}
}
}
...
...
src/libstd/sys/windows/mod.rs
浏览文件 @
88c515da
...
...
@@ -195,7 +195,7 @@ fn wide_char_to_multi_byte(code_page: u32,
}
}
pub
fn
truncate_utf16_at_nul
(
v
:
&
[
u16
])
->
&
[
u16
]
{
pub
fn
truncate_utf16_at_nul
<
'a
>
(
v
:
&
'a
[
u16
])
->
&
'a
[
u16
]
{
match
v
.iter
()
.position
(|
c
|
*
c
==
0
)
{
// don't include the 0
Some
(
i
)
=>
&
v
[
..
i
],
...
...
src/libstd/sys/windows/path.rs
浏览文件 @
88c515da
...
...
@@ -19,7 +19,7 @@ pub fn is_verbatim_sep(b: u8) -> bool {
b
==
b
'\\'
}
pub
fn
parse_prefix
(
path
:
&
OsStr
)
->
Option
<
Prefix
<
'_
>>
{
pub
fn
parse_prefix
<
'a
>
(
path
:
&
'a
OsStr
)
->
Option
<
Prefix
<
'a
>>
{
use
crate
::
path
::
Prefix
::
*
;
unsafe
{
// The unsafety here stems from converting between &OsStr and &[u8]
...
...
src/libstd/sys_common/io.rs
浏览文件 @
88c515da
...
...
@@ -16,7 +16,7 @@ pub fn join(&self, path: &str) -> PathBuf {
p
.join
(
path
)
}
pub
fn
path
(
&
self
)
->
&
Path
{
pub
fn
path
<
'a
>
(
&
'a
self
)
->
&
'a
Path
{
let
TempDir
(
ref
p
)
=
*
self
;
p
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录