Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
503455bc
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,发现更多精彩内容 >>
提交
503455bc
编写于
7月 29, 2018
作者:
M
Matthew Jasper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused `mut`s
上级
75af9df7
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
14 addition
and
14 deletion
+14
-14
src/libfmt_macros/lib.rs
src/libfmt_macros/lib.rs
+1
-1
src/librustc/hir/lowering.rs
src/librustc/hir/lowering.rs
+1
-1
src/librustc/traits/error_reporting.rs
src/librustc/traits/error_reporting.rs
+1
-1
src/librustc/util/ppaux.rs
src/librustc/util/ppaux.rs
+1
-1
src/librustc_data_structures/sorted_map.rs
src/librustc_data_structures/sorted_map.rs
+1
-1
src/librustc_lint/unused.rs
src/librustc_lint/unused.rs
+1
-1
src/librustc_mir/borrow_check/nll/constraints/graph.rs
src/librustc_mir/borrow_check/nll/constraints/graph.rs
+2
-2
src/librustc_mir/build/matches/test.rs
src/librustc_mir/build/matches/test.rs
+1
-1
src/librustc_mir/monomorphize/partitioning.rs
src/librustc_mir/monomorphize/partitioning.rs
+1
-1
src/librustc_mir/transform/promote_consts.rs
src/librustc_mir/transform/promote_consts.rs
+1
-1
src/librustc_resolve/resolve_imports.rs
src/librustc_resolve/resolve_imports.rs
+1
-1
src/librustc_save_analysis/lib.rs
src/librustc_save_analysis/lib.rs
+1
-1
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+1
-1
未找到文件。
src/libfmt_macros/lib.rs
浏览文件 @
503455bc
...
...
@@ -168,7 +168,7 @@ fn next(&mut self) -> Option<Piece<'a>> {
if
self
.consume
(
'{'
)
{
Some
(
String
(
self
.string
(
pos
+
1
)))
}
else
{
let
mut
arg
=
self
.argument
();
let
arg
=
self
.argument
();
if
let
Some
(
arg_pos
)
=
self
.must_consume
(
'}'
)
.map
(|
end
|
{
(
pos
+
raw
+
1
,
end
+
raw
+
2
)
})
{
...
...
src/librustc/hir/lowering.rs
浏览文件 @
503455bc
...
...
@@ -2814,7 +2814,7 @@ fn lower_use_tree(
let
mut
defs
=
self
.expect_full_def_from_use
(
id
);
// we want to return *something* from this function, so hang onto the first item
// for later
let
mut
ret_def
=
defs
.next
()
.unwrap_or
(
Def
::
Err
);
let
ret_def
=
defs
.next
()
.unwrap_or
(
Def
::
Err
);
for
(
def
,
&
new_node_id
)
in
defs
.zip
([
id1
,
id2
]
.iter
())
{
let
vis
=
vis
.clone
();
...
...
src/librustc/traits/error_reporting.rs
浏览文件 @
503455bc
...
...
@@ -1054,7 +1054,7 @@ pub fn report_arg_count_mismatch(
// found arguments is empty (assume the user just wants to ignore args in this case).
// For example, if `expected_args_length` is 2, suggest `|_, _|`.
if
found_args
.is_empty
()
&&
is_closure
{
let
mut
underscores
=
"_"
.repeat
(
expected_args
.len
())
let
underscores
=
"_"
.repeat
(
expected_args
.len
())
.split
(
""
)
.filter
(|
s
|
!
s
.is_empty
())
.collect
::
<
Vec
<
_
>>
()
...
...
src/librustc/util/ppaux.rs
浏览文件 @
503455bc
...
...
@@ -354,7 +354,7 @@ fn parameterized<F: fmt::Write>(&mut self,
};
if
has_default
{
if
let
Some
(
substs
)
=
tcx
.lift
(
&
substs
)
{
let
mut
types
=
substs
.types
()
.rev
()
.skip
(
child_types
);
let
types
=
substs
.types
()
.rev
()
.skip
(
child_types
);
for
((
def_id
,
has_default
),
actual
)
in
type_params
.zip
(
types
)
{
if
!
has_default
{
break
;
...
...
src/librustc_data_structures/sorted_map.rs
浏览文件 @
503455bc
...
...
@@ -56,7 +56,7 @@ pub fn from_presorted_elements(elements: Vec<(K, V)>) -> SortedMap<K, V>
pub
fn
insert
(
&
mut
self
,
key
:
K
,
mut
value
:
V
)
->
Option
<
V
>
{
match
self
.lookup_index_for
(
&
key
)
{
Ok
(
index
)
=>
{
let
mut
slot
=
unsafe
{
let
slot
=
unsafe
{
self
.data
.get_unchecked_mut
(
index
)
};
mem
::
swap
(
&
mut
slot
.1
,
&
mut
value
);
...
...
src/librustc_lint/unused.rs
浏览文件 @
503455bc
...
...
@@ -146,7 +146,7 @@ fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
fn
check_must_use
(
cx
:
&
LateContext
,
def_id
:
DefId
,
sp
:
Span
,
describe_path
:
&
str
)
->
bool
{
for
attr
in
cx
.tcx
.get_attrs
(
def_id
)
.iter
()
{
if
attr
.check_name
(
"must_use"
)
{
let
m
ut
m
sg
=
format!
(
"unused {}`{}` which must be used"
,
let
msg
=
format!
(
"unused {}`{}` which must be used"
,
describe_path
,
cx
.tcx
.item_path_str
(
def_id
));
let
mut
err
=
cx
.struct_span_lint
(
UNUSED_MUST_USE
,
sp
,
&
msg
);
// check for #[must_use = "..."]
...
...
src/librustc_mir/borrow_check/nll/constraints/graph.rs
浏览文件 @
503455bc
...
...
@@ -28,8 +28,8 @@ impl ConstraintGraph {
let
mut
next_constraints
=
IndexVec
::
from_elem
(
None
,
&
set
.constraints
);
for
(
idx
,
constraint
)
in
set
.constraints
.iter_enumerated
()
.rev
()
{
let
mut
head
=
&
mut
first_constraints
[
constraint
.sup
];
let
mut
next
=
&
mut
next_constraints
[
idx
];
let
head
=
&
mut
first_constraints
[
constraint
.sup
];
let
next
=
&
mut
next_constraints
[
idx
];
debug_assert!
(
next
.is_none
());
*
next
=
*
head
;
*
head
=
Some
(
idx
);
...
...
src/librustc_mir/build/matches/test.rs
浏览文件 @
503455bc
...
...
@@ -259,7 +259,7 @@ pub fn perform_test(&mut self,
}
TestKind
::
Eq
{
value
,
mut
ty
}
=>
{
let
mut
val
=
Operand
::
Copy
(
place
.clone
());
let
val
=
Operand
::
Copy
(
place
.clone
());
let
mut
expect
=
self
.literal_operand
(
test
.span
,
ty
,
value
);
// Use PartialEq::eq instead of BinOp::Eq
// (the binop can only handle primitives)
...
...
src/librustc_mir/monomorphize/partitioning.rs
浏览文件 @
503455bc
...
...
@@ -353,7 +353,7 @@ fn place_root_mono_items<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
Visibility
::
Hidden
}
};
let
(
linkage
,
mut
visibility
)
=
match
mono_item
.explicit_linkage
(
tcx
)
{
let
(
linkage
,
visibility
)
=
match
mono_item
.explicit_linkage
(
tcx
)
{
Some
(
explicit_linkage
)
=>
(
explicit_linkage
,
Visibility
::
Default
),
None
=>
{
match
mono_item
{
...
...
src/librustc_mir/transform/promote_consts.rs
浏览文件 @
503455bc
...
...
@@ -390,7 +390,7 @@ pub fn promote_candidates<'a, 'tcx>(mir: &mut Mir<'tcx>,
LocalDecl
::
new_return_place
(
tcx
.types.never
,
mir
.span
)
)
.collect
();
let
mut
promoter
=
Promoter
{
let
promoter
=
Promoter
{
promoted
:
Mir
::
new
(
IndexVec
::
new
(),
// FIXME: maybe try to filter this to avoid blowing up
...
...
src/librustc_resolve/resolve_imports.rs
浏览文件 @
503455bc
...
...
@@ -865,7 +865,7 @@ fn finalize_import(&mut self, directive: &'b ImportDirective<'b>) -> Option<(Spa
// this may resolve to either a value or a type, but for documentation
// purposes it's good enough to just favor one over the other.
self
.per_ns
(|
this
,
ns
|
if
let
Some
(
binding
)
=
result
[
ns
]
.get
()
.ok
()
{
let
mut
import
=
this
.import_map
.entry
(
directive
.id
)
.or_default
();
let
import
=
this
.import_map
.entry
(
directive
.id
)
.or_default
();
import
[
ns
]
=
Some
(
PathResolution
::
new
(
binding
.def
()));
});
...
...
src/librustc_save_analysis/lib.rs
浏览文件 @
503455bc
...
...
@@ -423,7 +423,7 @@ pub fn get_method_data(&self, id: ast::NodeId, name: ast::Name, span: Span) -> O
let
mut
qualname
=
String
::
from
(
"<"
);
qualname
.push_str
(
&
self
.tcx.hir
.node_to_pretty_string
(
ty
.id
));
let
mut
trait_id
=
self
.tcx
.trait_id_of_impl
(
impl_id
);
let
trait_id
=
self
.tcx
.trait_id_of_impl
(
impl_id
);
let
mut
decl_id
=
None
;
let
mut
docs
=
String
::
new
();
let
mut
attrs
=
vec!
[];
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
503455bc
...
...
@@ -1172,7 +1172,7 @@ fn resolve(cx: &DocContext, path_str: &str, is_val: bool) -> Result<(Def, Option
// Try looking for methods and associated items
let
mut
split
=
path_str
.rsplitn
(
2
,
"::"
);
let
mut
item_name
=
if
let
Some
(
first
)
=
split
.next
()
{
let
item_name
=
if
let
Some
(
first
)
=
split
.next
()
{
first
}
else
{
return
Err
(())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录