Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
bdc9291e
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,发现更多精彩内容 >>
提交
bdc9291e
编写于
12月 30, 2020
作者:
M
Matthias Krüger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)
上级
b9c403be
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
21 addition
and
27 deletion
+21
-27
compiler/rustc_codegen_ssa/src/mir/block.rs
compiler/rustc_codegen_ssa/src/mir/block.rs
+1
-1
compiler/rustc_driver/src/lib.rs
compiler/rustc_driver/src/lib.rs
+1
-1
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_infer/src/infer/error_reporting/mod.rs
+2
-2
compiler/rustc_macros/src/session_diagnostic.rs
compiler/rustc_macros/src/session_diagnostic.rs
+1
-1
compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs
compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs
+1
-1
compiler/rustc_mir/src/borrow_check/type_check/liveness/local_use_map.rs
...mir/src/borrow_check/type_check/liveness/local_use_map.rs
+1
-5
compiler/rustc_mir/src/interpret/validity.rs
compiler/rustc_mir/src/interpret/validity.rs
+1
-1
compiler/rustc_mir/src/transform/coverage/counters.rs
compiler/rustc_mir/src/transform/coverage/counters.rs
+3
-3
compiler/rustc_mir/src/transform/function_item_references.rs
compiler/rustc_mir/src/transform/function_item_references.rs
+2
-2
compiler/rustc_mir_build/src/build/expr/as_place.rs
compiler/rustc_mir_build/src/build/expr/as_place.rs
+3
-3
compiler/rustc_resolve/src/late.rs
compiler/rustc_resolve/src/late.rs
+3
-5
compiler/rustc_session/src/filesearch.rs
compiler/rustc_session/src/filesearch.rs
+1
-1
src/librustdoc/html/render/mod.rs
src/librustdoc/html/render/mod.rs
+1
-1
未找到文件。
compiler/rustc_codegen_ssa/src/mir/block.rs
浏览文件 @
bdc9291e
...
...
@@ -522,7 +522,7 @@ fn codegen_call_terminator(
mut
bx
:
Bx
,
terminator
:
&
mir
::
Terminator
<
'tcx
>
,
func
:
&
mir
::
Operand
<
'tcx
>
,
args
:
&
Vec
<
mir
::
Operand
<
'tcx
>>
,
args
:
&
[
mir
::
Operand
<
'tcx
>
]
,
destination
:
&
Option
<
(
mir
::
Place
<
'tcx
>
,
mir
::
BasicBlock
)
>
,
cleanup
:
Option
<
mir
::
BasicBlock
>
,
fn_span
:
Span
,
...
...
compiler/rustc_driver/src/lib.rs
浏览文件 @
bdc9291e
...
...
@@ -603,7 +603,7 @@ fn handle_explain(registry: Registry, code: &str, output: ErrorOutputType) {
}
}
fn
show_content_with_pager
(
content
:
&
String
)
{
fn
show_content_with_pager
(
content
:
&
str
)
{
let
pager_name
=
env
::
var_os
(
"PAGER"
)
.unwrap_or_else
(||
{
if
cfg!
(
windows
)
{
OsString
::
from
(
"more.com"
)
}
else
{
OsString
::
from
(
"less"
)
}
});
...
...
compiler/rustc_infer/src/infer/error_reporting/mod.rs
浏览文件 @
bdc9291e
...
...
@@ -417,7 +417,7 @@ pub fn report_region_errors(&self, errors: &Vec<RegionResolutionError<'tcx>>) {
// obviously it never weeds out ALL errors.
fn
process_errors
(
&
self
,
errors
:
&
Vec
<
RegionResolutionError
<
'tcx
>>
,
errors
:
&
[
RegionResolutionError
<
'tcx
>
]
,
)
->
Vec
<
RegionResolutionError
<
'tcx
>>
{
debug!
(
"process_errors()"
);
...
...
@@ -442,7 +442,7 @@ fn process_errors(
};
let
mut
errors
=
if
errors
.iter
()
.all
(|
e
|
is_bound_failure
(
e
))
{
errors
.
clone
()
errors
.
to_owned
()
}
else
{
errors
.iter
()
.filter
(|
&
e
|
!
is_bound_failure
(
e
))
.cloned
()
.collect
()
};
...
...
compiler/rustc_macros/src/session_diagnostic.rs
浏览文件 @
bdc9291e
...
...
@@ -574,7 +574,7 @@ fn generate_non_option_field_code(
/// format!("Expected a point greater than ({x}, {y})", x = self.x, y = self.y)
/// ```
/// This function builds the entire call to format!.
fn
build_format
(
&
self
,
input
:
&
String
,
span
:
proc_macro2
::
Span
)
->
proc_macro2
::
TokenStream
{
fn
build_format
(
&
self
,
input
:
&
str
,
span
:
proc_macro2
::
Span
)
->
proc_macro2
::
TokenStream
{
// This set is used later to generate the final format string. To keep builds reproducible,
// the iteration order needs to be deterministic, hence why we use a BTreeSet here instead
// of a HashSet.
...
...
compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs
浏览文件 @
bdc9291e
...
...
@@ -954,7 +954,7 @@ fn closure_span(
&
self
,
def_id
:
DefId
,
target_place
:
PlaceRef
<
'tcx
>
,
places
:
&
Vec
<
Operand
<
'tcx
>>
,
places
:
&
[
Operand
<
'tcx
>
]
,
)
->
Option
<
(
Span
,
Option
<
GeneratorKind
>
,
Span
)
>
{
debug!
(
"closure_span: def_id={:?} target_place={:?} places={:?}"
,
...
...
compiler/rustc_mir/src/borrow_check/type_check/liveness/local_use_map.rs
浏览文件 @
bdc9291e
...
...
@@ -58,11 +58,7 @@ fn next(elem: &Self) -> Option<AppearanceIndex> {
}
impl
LocalUseMap
{
crate
fn
build
(
live_locals
:
&
Vec
<
Local
>
,
elements
:
&
RegionValueElements
,
body
:
&
Body
<
'_
>
,
)
->
Self
{
crate
fn
build
(
live_locals
:
&
[
Local
],
elements
:
&
RegionValueElements
,
body
:
&
Body
<
'_
>
)
->
Self
{
let
nones
=
IndexVec
::
from_elem_n
(
None
,
body
.local_decls
.len
());
let
mut
local_use_map
=
LocalUseMap
{
first_def_at
:
nones
.clone
(),
...
...
compiler/rustc_mir/src/interpret/validity.rs
浏览文件 @
bdc9291e
...
...
@@ -153,7 +153,7 @@ pub fn track(&mut self, op: T, path: impl FnOnce() -> PATH) {
}
/// Format a path
fn
write_path
(
out
:
&
mut
String
,
path
:
&
Vec
<
PathElem
>
)
{
fn
write_path
(
out
:
&
mut
String
,
path
:
&
[
PathElem
]
)
{
use
self
::
PathElem
::
*
;
for
elem
in
path
.iter
()
{
...
...
compiler/rustc_mir/src/transform/coverage/counters.rs
浏览文件 @
bdc9291e
...
...
@@ -140,7 +140,7 @@ fn new(
/// message for subsequent debugging.
fn
make_bcb_counters
(
&
mut
self
,
coverage_spans
:
&
Vec
<
CoverageSpan
>
,
coverage_spans
:
&
[
CoverageSpan
]
,
)
->
Result
<
Vec
<
CoverageKind
>
,
Error
>
{
debug!
(
"make_bcb_counters(): adding a counter or expression to each BasicCoverageBlock"
);
let
num_bcbs
=
self
.basic_coverage_blocks
.num_nodes
();
...
...
@@ -465,7 +465,7 @@ fn recursive_get_or_make_edge_counter_operand(
fn
choose_preferred_expression_branch
(
&
self
,
traversal
:
&
TraverseCoverageGraphWithLoops
,
branches
:
&
Vec
<
BcbBranch
>
,
branches
:
&
[
BcbBranch
]
,
)
->
BcbBranch
{
let
branch_needs_a_counter
=
|
branch
:
&
BcbBranch
|
branch
.counter
(
&
self
.basic_coverage_blocks
)
.is_none
();
...
...
@@ -509,7 +509,7 @@ fn choose_preferred_expression_branch(
fn
find_some_reloop_branch
(
&
self
,
traversal
:
&
TraverseCoverageGraphWithLoops
,
branches
:
&
Vec
<
BcbBranch
>
,
branches
:
&
[
BcbBranch
]
,
)
->
Option
<
BcbBranch
>
{
let
branch_needs_a_counter
=
|
branch
:
&
BcbBranch
|
branch
.counter
(
&
self
.basic_coverage_blocks
)
.is_none
();
...
...
compiler/rustc_mir/src/transform/function_item_references.rs
浏览文件 @
bdc9291e
...
...
@@ -99,7 +99,7 @@ fn check_bound_args(
&
self
,
def_id
:
DefId
,
substs_ref
:
SubstsRef
<
'tcx
>
,
args
:
&
Vec
<
Operand
<
'tcx
>>
,
args
:
&
[
Operand
<
'tcx
>
]
,
source_info
:
SourceInfo
,
)
{
let
param_env
=
self
.tcx
.param_env
(
def_id
);
...
...
@@ -162,7 +162,7 @@ fn is_fn_ref(ty: Ty<'tcx>) -> Option<(DefId, SubstsRef<'tcx>)> {
.unwrap_or
(
None
)
}
fn
nth_arg_span
(
&
self
,
args
:
&
Vec
<
Operand
<
'tcx
>>
,
n
:
usize
)
->
Span
{
fn
nth_arg_span
(
&
self
,
args
:
&
[
Operand
<
'tcx
>
]
,
n
:
usize
)
->
Span
{
match
&
args
[
n
]
{
Operand
::
Copy
(
place
)
|
Operand
::
Move
(
place
)
=>
{
self
.body.local_decls
[
place
.local
]
.source_info.span
...
...
compiler/rustc_mir_build/src/build/expr/as_place.rs
浏览文件 @
bdc9291e
...
...
@@ -79,7 +79,7 @@
/// part of a path that is captued by a closure. We stop applying projections once we see the first
/// projection that isn't captured by a closure.
fn
convert_to_hir_projections_and_truncate_for_capture
<
'tcx
>
(
mir_projections
:
&
Vec
<
PlaceElem
<
'tcx
>>
,
mir_projections
:
&
[
PlaceElem
<
'tcx
>
]
,
)
->
Vec
<
HirProjectionKind
>
{
let
mut
hir_projections
=
Vec
::
new
();
...
...
@@ -128,7 +128,7 @@ fn convert_to_hir_projections_and_truncate_for_capture<'tcx>(
/// list are being applied to the same root variable.
fn
is_ancestor_or_same_capture
(
proj_possible_ancestor
:
&
Vec
<
HirProjectionKind
>
,
proj_capture
:
&
Vec
<
HirProjectionKind
>
,
proj_capture
:
&
[
HirProjectionKind
]
,
)
->
bool
{
// We want to make sure `is_ancestor_or_same_capture("x.0.0", "x.0")` to return false.
// Therefore we can't just check if all projections are same in the zipped iterator below.
...
...
@@ -171,7 +171,7 @@ fn find_capture_matching_projections<'a, 'tcx>(
typeck_results
:
&
'a
ty
::
TypeckResults
<
'tcx
>
,
var_hir_id
:
HirId
,
closure_def_id
:
DefId
,
projections
:
&
Vec
<
PlaceElem
<
'tcx
>>
,
projections
:
&
[
PlaceElem
<
'tcx
>
]
,
)
->
Option
<
(
usize
,
&
'a
ty
::
CapturedPlace
<
'tcx
>
)
>
{
let
closure_min_captures
=
typeck_results
.closure_min_captures
.get
(
&
closure_def_id
)
?
;
let
root_variable_min_captures
=
closure_min_captures
.get
(
&
var_hir_id
)
?
;
...
...
compiler/rustc_resolve/src/late.rs
浏览文件 @
bdc9291e
...
...
@@ -1151,13 +1151,11 @@ fn with_current_self_item<T>(&mut self, self_item: &Item, f: impl FnOnce(&mut Se
/// When evaluating a `trait` use its associated types' idents for suggestions in E0412.
fn
with_trait_items
<
T
>
(
&
mut
self
,
trait_items
:
&
'ast
Vec
<
P
<
AssocItem
>>
,
trait_items
:
&
'ast
[
P
<
AssocItem
>
]
,
f
:
impl
FnOnce
(
&
mut
Self
)
->
T
,
)
->
T
{
let
trait_assoc_items
=
replace
(
&
mut
self
.diagnostic_metadata.current_trait_assoc_items
,
Some
(
&
trait_items
[
..
]),
);
let
trait_assoc_items
=
replace
(
&
mut
self
.diagnostic_metadata.current_trait_assoc_items
,
Some
(
&
trait_items
));
let
result
=
f
(
self
);
self
.diagnostic_metadata.current_trait_assoc_items
=
trait_assoc_items
;
result
...
...
compiler/rustc_session/src/filesearch.rs
浏览文件 @
bdc9291e
...
...
@@ -76,7 +76,7 @@ fn is_rlib(spf: &SearchPathFile) -> bool {
pub
fn
new
(
sysroot
:
&
'a
Path
,
triple
:
&
'a
str
,
search_paths
:
&
'a
Vec
<
SearchPath
>
,
search_paths
:
&
'a
[
SearchPath
]
,
tlib_path
:
&
'a
SearchPath
,
kind
:
PathKind
,
)
->
FileSearch
<
'a
>
{
...
...
src/librustdoc/html/render/mod.rs
浏览文件 @
bdc9291e
...
...
@@ -3483,7 +3483,7 @@ enum AssocItemLink<'a> {
}
impl
<
'a
>
AssocItemLink
<
'a
>
{
fn
anchor
(
&
self
,
id
:
&
'a
String
)
->
Self
{
fn
anchor
(
&
self
,
id
:
&
'a
str
)
->
Self
{
match
*
self
{
AssocItemLink
::
Anchor
(
_
)
=>
AssocItemLink
::
Anchor
(
Some
(
&
id
)),
ref
other
=>
*
other
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录