Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
2afa4cc9
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
2afa4cc9
编写于
3月 27, 2021
作者:
M
Mara Bos
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use DebugStruct::finish_non_exhaustive() in std.
上级
feaac19f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
21 addition
and
15 deletion
+21
-15
library/std/src/collections/hash/map.rs
library/std/src/collections/hash/map.rs
+9
-6
library/std/src/fs.rs
library/std/src/fs.rs
+1
-1
library/std/src/io/buffered/linewriter.rs
library/std/src/io/buffered/linewriter.rs
+1
-1
library/std/src/lazy.rs
library/std/src/lazy.rs
+1
-1
library/std/src/process.rs
library/std/src/process.rs
+1
-1
library/std/src/sync/mpsc/mod.rs
library/std/src/sync/mpsc/mod.rs
+3
-3
library/std/src/sys/wasi/fs.rs
library/std/src/sys/wasi/fs.rs
+1
-1
library/std/src/thread/mod.rs
library/std/src/thread/mod.rs
+4
-1
未找到文件。
library/std/src/collections/hash/map.rs
浏览文件 @
2afa4cc9
...
...
@@ -1793,7 +1793,7 @@ pub fn insert_hashed_nocheck(self, hash: u64, key: K, value: V) -> (&'a mut K, &
#[unstable(feature
=
"hash_raw_entry"
,
issue
=
"56167"
)]
impl
<
K
,
V
,
S
>
Debug
for
RawEntryBuilderMut
<
'_
,
K
,
V
,
S
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"RawEntryBuilder"
)
.finish
()
f
.debug_struct
(
"RawEntryBuilder"
)
.finish
_non_exhaustive
()
}
}
...
...
@@ -1813,21 +1813,21 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f
.debug_struct
(
"RawOccupiedEntryMut"
)
.field
(
"key"
,
self
.key
())
.field
(
"value"
,
self
.get
())
.finish
()
.finish
_non_exhaustive
()
}
}
#[unstable(feature
=
"hash_raw_entry"
,
issue
=
"56167"
)]
impl
<
K
,
V
,
S
>
Debug
for
RawVacantEntryMut
<
'_
,
K
,
V
,
S
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"RawVacantEntryMut"
)
.finish
()
f
.debug_struct
(
"RawVacantEntryMut"
)
.finish
_non_exhaustive
()
}
}
#[unstable(feature
=
"hash_raw_entry"
,
issue
=
"56167"
)]
impl
<
K
,
V
,
S
>
Debug
for
RawEntryBuilder
<
'_
,
K
,
V
,
S
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"RawEntryBuilder"
)
.finish
()
f
.debug_struct
(
"RawEntryBuilder"
)
.finish
_non_exhaustive
()
}
}
...
...
@@ -1867,7 +1867,10 @@ pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
#[stable(feature
=
"debug_hash_map"
,
since
=
"1.12.0"
)]
impl
<
K
:
Debug
,
V
:
Debug
>
Debug
for
OccupiedEntry
<
'_
,
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"OccupiedEntry"
)
.field
(
"key"
,
self
.key
())
.field
(
"value"
,
self
.get
())
.finish
()
f
.debug_struct
(
"OccupiedEntry"
)
.field
(
"key"
,
self
.key
())
.field
(
"value"
,
self
.get
())
.finish_non_exhaustive
()
}
}
...
...
@@ -1903,7 +1906,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
.field
(
"key"
,
self
.entry
.key
())
.field
(
"old_value"
,
self
.entry
.get
())
.field
(
"new_value"
,
&
self
.value
)
.finish
()
.finish
_non_exhaustive
()
}
}
...
...
library/std/src/fs.rs
浏览文件 @
2afa4cc9
...
...
@@ -1154,7 +1154,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
.field
(
"modified"
,
&
self
.modified
())
.field
(
"accessed"
,
&
self
.accessed
())
.field
(
"created"
,
&
self
.created
())
.finish
()
.finish
_non_exhaustive
()
}
}
...
...
library/std/src/io/buffered/linewriter.rs
浏览文件 @
2afa4cc9
...
...
@@ -227,6 +227,6 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
"buffer"
,
&
format_args!
(
"{}/{}"
,
self
.inner
.buffer
()
.len
(),
self
.inner
.capacity
()),
)
.finish
()
.finish
_non_exhaustive
()
}
}
library/std/src/lazy.rs
浏览文件 @
2afa4cc9
...
...
@@ -515,7 +515,7 @@ pub struct SyncLazy<T, F = fn() -> T> {
#[unstable(feature
=
"once_cell"
,
issue
=
"74465"
)]
impl
<
T
:
fmt
::
Debug
,
F
>
fmt
::
Debug
for
SyncLazy
<
T
,
F
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"Lazy"
)
.field
(
"cell"
,
&
self
.cell
)
.fi
eld
(
"init"
,
&
".."
)
.finish
()
f
.debug_struct
(
"Lazy"
)
.field
(
"cell"
,
&
self
.cell
)
.fi
nish_non_exhaustive
()
}
}
...
...
library/std/src/process.rs
浏览文件 @
2afa4cc9
...
...
@@ -234,7 +234,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
.field
(
"stdin"
,
&
self
.stdin
)
.field
(
"stdout"
,
&
self
.stdout
)
.field
(
"stderr"
,
&
self
.stderr
)
.finish
()
.finish
_non_exhaustive
()
}
}
...
...
library/std/src/sync/mpsc/mod.rs
浏览文件 @
2afa4cc9
...
...
@@ -864,7 +864,7 @@ fn drop(&mut self) {
#[stable(feature
=
"mpsc_debug"
,
since
=
"1.8.0"
)]
impl
<
T
>
fmt
::
Debug
for
Sender
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"Sender"
)
.finish
()
f
.debug_struct
(
"Sender"
)
.finish
_non_exhaustive
()
}
}
...
...
@@ -991,7 +991,7 @@ fn drop(&mut self) {
#[stable(feature
=
"mpsc_debug"
,
since
=
"1.8.0"
)]
impl
<
T
>
fmt
::
Debug
for
SyncSender
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"SyncSender"
)
.finish
()
f
.debug_struct
(
"SyncSender"
)
.finish
_non_exhaustive
()
}
}
...
...
@@ -1470,7 +1470,7 @@ fn drop(&mut self) {
#[stable(feature
=
"mpsc_debug"
,
since
=
"1.8.0"
)]
impl
<
T
>
fmt
::
Debug
for
Receiver
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"Receiver"
)
.finish
()
f
.debug_struct
(
"Receiver"
)
.finish
_non_exhaustive
()
}
}
...
...
library/std/src/sys/wasi/fs.rs
浏览文件 @
2afa4cc9
...
...
@@ -130,7 +130,7 @@ pub fn bits(&self) -> wasi::Filetype {
impl
fmt
::
Debug
for
ReadDir
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"ReadDir"
)
.finish
()
f
.debug_struct
(
"ReadDir"
)
.finish
_non_exhaustive
()
}
}
...
...
library/std/src/thread/mod.rs
浏览文件 @
2afa4cc9
...
...
@@ -1176,7 +1176,10 @@ fn cname(&self) -> Option<&CStr> {
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
impl
fmt
::
Debug
for
Thread
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_struct
(
"Thread"
)
.field
(
"id"
,
&
self
.id
())
.field
(
"name"
,
&
self
.name
())
.finish
()
f
.debug_struct
(
"Thread"
)
.field
(
"id"
,
&
self
.id
())
.field
(
"name"
,
&
self
.name
())
.finish_non_exhaustive
()
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录