Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e161d5cf
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,发现更多精彩内容 >>
提交
e161d5cf
编写于
5月 19, 2015
作者:
S
Steven Fackler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stabilize debug builders for 1.2.0
上级
43cf733b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
27 deletion
+24
-27
src/libcollections/lib.rs
src/libcollections/lib.rs
+0
-1
src/libcore/fmt/builders.rs
src/libcore/fmt/builders.rs
+18
-13
src/libcore/fmt/mod.rs
src/libcore/fmt/mod.rs
+5
-10
src/libcoretest/lib.rs
src/libcoretest/lib.rs
+0
-1
src/libstd/lib.rs
src/libstd/lib.rs
+0
-1
src/test/run-pass/deriving-associated-types.rs
src/test/run-pass/deriving-associated-types.rs
+1
-1
未找到文件。
src/libcollections/lib.rs
浏览文件 @
e161d5cf
...
...
@@ -39,7 +39,6 @@
#![feature(str_char)]
#![feature(str_words)]
#![feature(slice_patterns)]
#![feature(debug_builders)]
#![feature(utf8_error)]
#![cfg_attr(test,
feature(rand,
rustc_private,
test,
hash,
collections,
collections_drain,
collections_range))]
...
...
src/libcore/fmt/builders.rs
浏览文件 @
e161d5cf
...
...
@@ -54,6 +54,7 @@ fn write_str(&mut self, mut s: &str) -> fmt::Result {
///
/// Constructed by the `Formatter::debug_struct` method.
#[must_use]
#[stable(feature
=
"debug_builders"
,
since
=
"1.2.0"
)]
pub
struct
DebugStruct
<
'a
,
'b
:
'a
>
{
fmt
:
&
'a
mut
fmt
::
Formatter
<
'b
>
,
result
:
fmt
::
Result
,
...
...
@@ -72,7 +73,7 @@ pub fn debug_struct_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str)
impl
<
'a
,
'b
:
'a
>
DebugStruct
<
'a
,
'b
>
{
/// Adds a new field to the generated struct output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
field
(
&
mut
self
,
name
:
&
str
,
value
:
&
fmt
::
Debug
)
->
&
mut
DebugStruct
<
'a
,
'b
>
{
self
.result
=
self
.result
.and_then
(|
_
|
{
let
prefix
=
if
self
.has_fields
{
...
...
@@ -94,7 +95,7 @@ pub fn field(&mut self, name: &str, value: &fmt::Debug) -> &mut DebugStruct<'a,
}
/// Finishes output and returns any error encountered.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
finish
(
&
mut
self
)
->
fmt
::
Result
{
if
self
.has_fields
{
self
.result
=
self
.result
.and_then
(|
_
|
{
...
...
@@ -117,6 +118,7 @@ fn is_pretty(&self) -> bool {
///
/// Constructed by the `Formatter::debug_tuple` method.
#[must_use]
#[stable(feature
=
"debug_builders"
,
since
=
"1.2.0"
)]
pub
struct
DebugTuple
<
'a
,
'b
:
'a
>
{
fmt
:
&
'a
mut
fmt
::
Formatter
<
'b
>
,
result
:
fmt
::
Result
,
...
...
@@ -134,7 +136,7 @@ pub fn debug_tuple_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> D
impl
<
'a
,
'b
:
'a
>
DebugTuple
<
'a
,
'b
>
{
/// Adds a new field to the generated tuple struct output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
field
(
&
mut
self
,
value
:
&
fmt
::
Debug
)
->
&
mut
DebugTuple
<
'a
,
'b
>
{
self
.result
=
self
.result
.and_then
(|
_
|
{
let
(
prefix
,
space
)
=
if
self
.has_fields
{
...
...
@@ -156,7 +158,7 @@ pub fn field(&mut self, value: &fmt::Debug) -> &mut DebugTuple<'a, 'b> {
}
/// Finishes output and returns any error encountered.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
finish
(
&
mut
self
)
->
fmt
::
Result
{
if
self
.has_fields
{
self
.result
=
self
.result
.and_then
(|
_
|
{
...
...
@@ -211,6 +213,7 @@ fn is_pretty(&self) -> bool {
///
/// Constructed by the `Formatter::debug_set` method.
#[must_use]
#[stable(feature
=
"debug_builders"
,
since
=
"1.2.0"
)]
pub
struct
DebugSet
<
'a
,
'b
:
'a
>
{
inner
:
DebugInner
<
'a
,
'b
>
,
}
...
...
@@ -228,14 +231,14 @@ pub fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b
impl
<
'a
,
'b
:
'a
>
DebugSet
<
'a
,
'b
>
{
/// Adds a new entry to the set output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
entry
(
&
mut
self
,
entry
:
&
fmt
::
Debug
)
->
&
mut
DebugSet
<
'a
,
'b
>
{
self
.inner
.entry
(
entry
);
self
}
/// Adds the contents of an iterator of entries to the set output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
entries
<
D
,
I
>
(
&
mut
self
,
entries
:
I
)
->
&
mut
DebugSet
<
'a
,
'b
>
where
D
:
fmt
::
Debug
,
I
:
IntoIterator
<
Item
=
D
>
{
for
entry
in
entries
{
...
...
@@ -245,7 +248,7 @@ pub fn entries<D, I>(&mut self, entries: I) -> &mut DebugSet<'a, 'b>
}
/// Finishes output and returns any error encountered.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
finish
(
&
mut
self
)
->
fmt
::
Result
{
self
.inner
.finish
();
self
.inner.result
.and_then
(|
_
|
self
.inner.fmt
.write_str
(
"}"
))
...
...
@@ -256,6 +259,7 @@ pub fn finish(&mut self) -> fmt::Result {
///
/// Constructed by the `Formatter::debug_list` method.
#[must_use]
#[stable(feature
=
"debug_builders"
,
since
=
"1.2.0"
)]
pub
struct
DebugList
<
'a
,
'b
:
'a
>
{
inner
:
DebugInner
<
'a
,
'b
>
,
}
...
...
@@ -273,14 +277,14 @@ pub fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a,
impl
<
'a
,
'b
:
'a
>
DebugList
<
'a
,
'b
>
{
/// Adds a new entry to the list output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
entry
(
&
mut
self
,
entry
:
&
fmt
::
Debug
)
->
&
mut
DebugList
<
'a
,
'b
>
{
self
.inner
.entry
(
entry
);
self
}
/// Adds the contents of an iterator of entries to the list output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
entries
<
D
,
I
>
(
&
mut
self
,
entries
:
I
)
->
&
mut
DebugList
<
'a
,
'b
>
where
D
:
fmt
::
Debug
,
I
:
IntoIterator
<
Item
=
D
>
{
for
entry
in
entries
{
...
...
@@ -290,7 +294,7 @@ pub fn entries<D, I>(&mut self, entries: I) -> &mut DebugList<'a, 'b>
}
/// Finishes output and returns any error encountered.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
finish
(
&
mut
self
)
->
fmt
::
Result
{
self
.inner
.finish
();
self
.inner.result
.and_then
(|
_
|
self
.inner.fmt
.write_str
(
"]"
))
...
...
@@ -301,6 +305,7 @@ pub fn finish(&mut self) -> fmt::Result {
///
/// Constructed by the `Formatter::debug_map` method.
#[must_use]
#[stable(feature
=
"debug_builders"
,
since
=
"1.2.0"
)]
pub
struct
DebugMap
<
'a
,
'b
:
'a
>
{
fmt
:
&
'a
mut
fmt
::
Formatter
<
'b
>
,
result
:
fmt
::
Result
,
...
...
@@ -318,7 +323,7 @@ pub fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b
impl
<
'a
,
'b
:
'a
>
DebugMap
<
'a
,
'b
>
{
/// Adds a new entry to the map output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
entry
(
&
mut
self
,
key
:
&
fmt
::
Debug
,
value
:
&
fmt
::
Debug
)
->
&
mut
DebugMap
<
'a
,
'b
>
{
self
.result
=
self
.result
.and_then
(|
_
|
{
if
self
.is_pretty
()
{
...
...
@@ -336,7 +341,7 @@ pub fn entry(&mut self, key: &fmt::Debug, value: &fmt::Debug) -> &mut DebugMap<'
}
/// Adds the contents of an iterator of entries to the map output.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
entries
<
K
,
V
,
I
>
(
&
mut
self
,
entries
:
I
)
->
&
mut
DebugMap
<
'a
,
'b
>
where
K
:
fmt
::
Debug
,
V
:
fmt
::
Debug
,
I
:
IntoIterator
<
Item
=
(
K
,
V
)
>
{
for
(
k
,
v
)
in
entries
{
...
...
@@ -346,7 +351,7 @@ pub fn entries<K, V, I>(&mut self, entries: I) -> &mut DebugMap<'a, 'b>
}
/// Finishes output and returns any error encountered.
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
pub
fn
finish
(
&
mut
self
)
->
fmt
::
Result
{
let
prefix
=
if
self
.is_pretty
()
&&
self
.has_fields
{
"
\n
"
}
else
{
""
};
self
.result
.and_then
(|
_
|
write!
(
self
.fmt
,
"{}}}"
,
prefix
))
...
...
src/libcore/fmt/mod.rs
浏览文件 @
e161d5cf
...
...
@@ -719,7 +719,6 @@ pub fn precision(&self) -> Option<usize> { self.precision }
/// # Examples
///
/// ```rust
/// # #![feature(debug_builders, core)]
/// use std::fmt;
///
/// struct Foo {
...
...
@@ -739,7 +738,7 @@ pub fn precision(&self) -> Option<usize> { self.precision }
/// // prints "Foo { bar: 10, baz: "Hello World" }"
/// println!("{:?}", Foo { bar: 10, baz: "Hello World".to_string() });
/// ```
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
#[inline]
pub
fn
debug_struct
<
'b
>
(
&
'b
mut
self
,
name
:
&
str
)
->
DebugStruct
<
'b
,
'a
>
{
builders
::
debug_struct_new
(
self
,
name
)
...
...
@@ -751,7 +750,6 @@ pub fn debug_struct<'b>(&'b mut self, name: &str) -> DebugStruct<'b, 'a> {
/// # Examples
///
/// ```rust
/// # #![feature(debug_builders, core)]
/// use std::fmt;
///
/// struct Foo(i32, String);
...
...
@@ -768,7 +766,7 @@ pub fn debug_struct<'b>(&'b mut self, name: &str) -> DebugStruct<'b, 'a> {
/// // prints "Foo(10, "Hello World")"
/// println!("{:?}", Foo(10, "Hello World".to_string()));
/// ```
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
#[inline]
pub
fn
debug_tuple
<
'b
>
(
&
'b
mut
self
,
name
:
&
str
)
->
DebugTuple
<
'b
,
'a
>
{
builders
::
debug_tuple_new
(
self
,
name
)
...
...
@@ -780,7 +778,6 @@ pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> {
/// # Examples
///
/// ```rust
/// # #![feature(debug_builders, core)]
/// use std::fmt;
///
/// struct Foo(Vec<i32>);
...
...
@@ -794,7 +791,7 @@ pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> {
/// // prints "[10, 11]"
/// println!("{:?}", Foo(vec![10, 11]));
/// ```
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
#[inline]
pub
fn
debug_list
<
'b
>
(
&
'b
mut
self
)
->
DebugList
<
'b
,
'a
>
{
builders
::
debug_list_new
(
self
)
...
...
@@ -806,7 +803,6 @@ pub fn debug_list<'b>(&'b mut self) -> DebugList<'b, 'a> {
/// # Examples
///
/// ```rust
/// # #![feature(debug_builders, core)]
/// use std::fmt;
///
/// struct Foo(Vec<i32>);
...
...
@@ -820,7 +816,7 @@ pub fn debug_list<'b>(&'b mut self) -> DebugList<'b, 'a> {
/// // prints "{10, 11}"
/// println!("{:?}", Foo(vec![10, 11]));
/// ```
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
#[inline]
pub
fn
debug_set
<
'b
>
(
&
'b
mut
self
)
->
DebugSet
<
'b
,
'a
>
{
builders
::
debug_set_new
(
self
)
...
...
@@ -832,7 +828,6 @@ pub fn debug_set<'b>(&'b mut self) -> DebugSet<'b, 'a> {
/// # Examples
///
/// ```rust
/// # #![feature(debug_builders, core)]
/// use std::fmt;
///
/// struct Foo(Vec<(String, i32)>);
...
...
@@ -846,7 +841,7 @@ pub fn debug_set<'b>(&'b mut self) -> DebugSet<'b, 'a> {
/// // prints "{"A": 10, "B": 11}"
/// println!("{:?}", Foo(vec![("A".to_string(), 10), ("B".to_string(), 11)]));
/// ```
#[
unstable(feature
=
"debug_builders"
,
reason
=
"method was just created
"
)]
#[
stable(feature
=
"debug_builders"
,
since
=
"1.2.0
"
)]
#[inline]
pub
fn
debug_map
<
'b
>
(
&
'b
mut
self
)
->
DebugMap
<
'b
,
'a
>
{
builders
::
debug_map_new
(
self
)
...
...
src/libcoretest/lib.rs
浏览文件 @
e161d5cf
...
...
@@ -20,7 +20,6 @@
#![feature(std_misc)]
#![feature(libc)]
#![feature(hash)]
#![feature(debug_builders)]
#![feature(unique)]
#![feature(step_by)]
#![feature(slice_patterns)]
...
...
src/libstd/lib.rs
浏览文件 @
e161d5cf
...
...
@@ -109,7 +109,6 @@
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(debug_builders)]
#![feature(into_cow)]
#![feature(lang_items)]
#![feature(libc)]
...
...
src/test/run-pass/deriving-associated-types.rs
浏览文件 @
e161d5cf
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(core
,
debug_builders
)]
#![feature(core)]
pub
trait
DeclaredTrait
{
type
Type
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录