Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
555df0f4
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,发现更多精彩内容 >>
未验证
提交
555df0f4
编写于
10月 25, 2018
作者:
P
Pietro Albini
提交者:
GitHub
10月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #55282 - sinkuu:redundant_clone, r=estebank
Remove redundant clone
上级
4f14bfdc
fda3326a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
7 addition
and
7 deletion
+7
-7
src/librustc/hir/print.rs
src/librustc/hir/print.rs
+1
-1
src/librustc/ich/caching_codemap_view.rs
src/librustc/ich/caching_codemap_view.rs
+1
-1
src/librustc/traits/project.rs
src/librustc/traits/project.rs
+1
-1
src/librustc/ty/sty.rs
src/librustc/ty/sty.rs
+1
-1
src/librustc_mir/hair/pattern/_match.rs
src/librustc_mir/hair/pattern/_match.rs
+2
-2
src/libsyntax/fold.rs
src/libsyntax/fold.rs
+1
-1
未找到文件。
src/librustc/hir/print.rs
浏览文件 @
555df0f4
...
@@ -180,7 +180,7 @@ pub fn new(cm: &'a SourceMap,
...
@@ -180,7 +180,7 @@ pub fn new(cm: &'a SourceMap,
State
{
State
{
s
:
pp
::
mk_printer
(
out
,
default_columns
),
s
:
pp
::
mk_printer
(
out
,
default_columns
),
cm
:
Some
(
cm
),
cm
:
Some
(
cm
),
comments
:
comments
.clone
()
,
comments
,
literals
:
literals
.unwrap_or_default
()
.into_iter
()
.peekable
(),
literals
:
literals
.unwrap_or_default
()
.into_iter
()
.peekable
(),
cur_cmnt
:
0
,
cur_cmnt
:
0
,
boxes
:
Vec
::
new
(),
boxes
:
Vec
::
new
(),
...
...
src/librustc/ich/caching_codemap_view.rs
浏览文件 @
555df0f4
...
@@ -44,7 +44,7 @@ pub fn new(source_map: &'cm SourceMap) -> CachingSourceMapView<'cm> {
...
@@ -44,7 +44,7 @@ pub fn new(source_map: &'cm SourceMap) -> CachingSourceMapView<'cm> {
CachingSourceMapView
{
CachingSourceMapView
{
source_map
,
source_map
,
line_cache
:
[
entry
.clone
(),
entry
.clone
(),
entry
.clone
()
],
line_cache
:
[
entry
.clone
(),
entry
.clone
(),
entry
],
time_stamp
:
0
,
time_stamp
:
0
,
}
}
}
}
...
...
src/librustc/traits/project.rs
浏览文件 @
555df0f4
...
@@ -340,7 +340,7 @@ fn fold<T:TypeFoldable<'tcx>>(&mut self, value: &T) -> T {
...
@@ -340,7 +340,7 @@ fn fold<T:TypeFoldable<'tcx>>(&mut self, value: &T) -> T {
let
value
=
self
.selcx
.infcx
()
.resolve_type_vars_if_possible
(
value
);
let
value
=
self
.selcx
.infcx
()
.resolve_type_vars_if_possible
(
value
);
if
!
value
.has_projections
()
{
if
!
value
.has_projections
()
{
value
.clone
()
value
}
else
{
}
else
{
value
.fold_with
(
self
)
value
.fold_with
(
self
)
}
}
...
...
src/librustc/ty/sty.rs
浏览文件 @
555df0f4
...
@@ -967,7 +967,7 @@ pub fn inputs_and_output(&self) -> ty::Binder<&'tcx List<Ty<'tcx>>> {
...
@@ -967,7 +967,7 @@ pub fn inputs_and_output(&self) -> ty::Binder<&'tcx List<Ty<'tcx>>> {
self
.map_bound_ref
(|
fn_sig
|
fn_sig
.inputs_and_output
)
self
.map_bound_ref
(|
fn_sig
|
fn_sig
.inputs_and_output
)
}
}
pub
fn
output
(
&
self
)
->
ty
::
Binder
<
Ty
<
'tcx
>>
{
pub
fn
output
(
&
self
)
->
ty
::
Binder
<
Ty
<
'tcx
>>
{
self
.map_bound_ref
(|
fn_sig
|
fn_sig
.output
()
.clone
()
)
self
.map_bound_ref
(|
fn_sig
|
fn_sig
.output
())
}
}
pub
fn
variadic
(
&
self
)
->
bool
{
pub
fn
variadic
(
&
self
)
->
bool
{
self
.skip_binder
()
.variadic
self
.skip_binder
()
.variadic
...
...
src/librustc_mir/hair/pattern/_match.rs
浏览文件 @
555df0f4
...
@@ -1048,7 +1048,7 @@ pub fn is_useful<'p, 'a: 'p, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
...
@@ -1048,7 +1048,7 @@ pub fn is_useful<'p, 'a: 'p, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
if
let
Some
(
constructors
)
=
pat_constructors
(
cx
,
v
[
0
],
pcx
)
{
if
let
Some
(
constructors
)
=
pat_constructors
(
cx
,
v
[
0
],
pcx
)
{
debug!
(
"is_useful - expanding constructors: {:#?}"
,
constructors
);
debug!
(
"is_useful - expanding constructors: {:#?}"
,
constructors
);
split_grouped_constructors
(
cx
.tcx
,
constructors
,
matrix
,
pcx
.ty
)
.into_iter
()
.map
(|
c
|
split_grouped_constructors
(
cx
.tcx
,
constructors
,
matrix
,
pcx
.ty
)
.into_iter
()
.map
(|
c
|
is_useful_specialized
(
cx
,
matrix
,
v
,
c
.clone
()
,
pcx
.ty
,
witness
)
is_useful_specialized
(
cx
,
matrix
,
v
,
c
,
pcx
.ty
,
witness
)
)
.find
(|
result
|
result
.is_useful
())
.unwrap_or
(
NotUseful
)
)
.find
(|
result
|
result
.is_useful
())
.unwrap_or
(
NotUseful
)
}
else
{
}
else
{
debug!
(
"is_useful - expanding wildcard"
);
debug!
(
"is_useful - expanding wildcard"
);
...
@@ -1096,7 +1096,7 @@ pub fn is_useful<'p, 'a: 'p, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
...
@@ -1096,7 +1096,7 @@ pub fn is_useful<'p, 'a: 'p, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
if
missing_ctors
.is_empty
()
&&
!
is_non_exhaustive
{
if
missing_ctors
.is_empty
()
&&
!
is_non_exhaustive
{
split_grouped_constructors
(
cx
.tcx
,
all_ctors
,
matrix
,
pcx
.ty
)
.into_iter
()
.map
(|
c
|
{
split_grouped_constructors
(
cx
.tcx
,
all_ctors
,
matrix
,
pcx
.ty
)
.into_iter
()
.map
(|
c
|
{
is_useful_specialized
(
cx
,
matrix
,
v
,
c
.clone
()
,
pcx
.ty
,
witness
)
is_useful_specialized
(
cx
,
matrix
,
v
,
c
,
pcx
.ty
,
witness
)
})
.find
(|
result
|
result
.is_useful
())
.unwrap_or
(
NotUseful
)
})
.find
(|
result
|
result
.is_useful
())
.unwrap_or
(
NotUseful
)
}
else
{
}
else
{
let
matrix
=
rows
.iter
()
.filter_map
(|
r
|
{
let
matrix
=
rows
.iter
()
.filter_map
(|
r
|
{
...
...
src/libsyntax/fold.rs
浏览文件 @
555df0f4
...
@@ -965,7 +965,7 @@ pub fn noop_fold_item_kind<T: Folder>(i: ItemKind, folder: &mut T) -> ItemKind {
...
@@ -965,7 +965,7 @@ pub fn noop_fold_item_kind<T: Folder>(i: ItemKind, folder: &mut T) -> ItemKind {
polarity
,
polarity
,
defaultness
,
defaultness
,
folder
.fold_generics
(
generics
),
folder
.fold_generics
(
generics
),
ifce
.map
(|
trait_ref
|
folder
.fold_trait_ref
(
trait_ref
.clone
()
)),
ifce
.map
(|
trait_ref
|
folder
.fold_trait_ref
(
trait_ref
)),
folder
.fold_ty
(
ty
),
folder
.fold_ty
(
ty
),
impl_items
.move_flat_map
(|
item
|
folder
.fold_impl_item
(
item
)),
impl_items
.move_flat_map
(|
item
|
folder
.fold_impl_item
(
item
)),
),
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录