Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
fa70398d
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,发现更多精彩内容 >>
未验证
提交
fa70398d
编写于
3月 28, 2021
作者:
Y
Yuki Okushi
提交者:
GitHub
3月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #83526 - klensy:lazy-too, r=petrochenkov
lazily calls some fns Replaced some fn's with it's lazy variants.
上级
3f41fdd2
229d1999
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
13 deletion
+14
-13
compiler/rustc_errors/src/json.rs
compiler/rustc_errors/src/json.rs
+1
-1
compiler/rustc_middle/src/ty/instance.rs
compiler/rustc_middle/src/ty/instance.rs
+4
-3
compiler/rustc_middle/src/ty/query/on_disk_cache.rs
compiler/rustc_middle/src/ty/query/on_disk_cache.rs
+1
-1
compiler/rustc_mir/src/borrow_check/diagnostics/outlives_suggestion.rs
...c_mir/src/borrow_check/diagnostics/outlives_suggestion.rs
+1
-1
compiler/rustc_resolve/src/late.rs
compiler/rustc_resolve/src/late.rs
+1
-1
compiler/rustc_resolve/src/late/diagnostics.rs
compiler/rustc_resolve/src/late/diagnostics.rs
+5
-5
library/test/src/helpers/exit_code.rs
library/test/src/helpers/exit_code.rs
+1
-1
未找到文件。
compiler/rustc_errors/src/json.rs
浏览文件 @
fa70398d
...
...
@@ -493,7 +493,7 @@ fn line_from_source_file(
h_end
:
usize
,
)
->
DiagnosticSpanLine
{
DiagnosticSpanLine
{
text
:
sf
.get_line
(
index
)
.map_or
(
String
::
new
()
,
|
l
|
l
.into_owned
()),
text
:
sf
.get_line
(
index
)
.map_or
_else
(
String
::
new
,
|
l
|
l
.into_owned
()),
highlight_start
:
h_start
,
highlight_end
:
h_end
,
}
...
...
compiler/rustc_middle/src/ty/instance.rs
浏览文件 @
fa70398d
...
...
@@ -216,9 +216,10 @@ pub fn generates_cgu_internal_copy(&self, tcx: TyCtxt<'tcx>) -> bool {
// drops of `Option::None` before LTO. We also respect the intent of
// `#[inline]` on `Drop::drop` implementations.
return
ty
.ty_adt_def
()
.map_or
(
true
,
|
adt_def
|
{
adt_def
.destructor
(
tcx
)
.map_or
(
adt_def
.is_enum
(),
|
dtor
|
{
tcx
.codegen_fn_attrs
(
dtor
.did
)
.requests_inline
()
})
adt_def
.destructor
(
tcx
)
.map_or_else
(
||
adt_def
.is_enum
(),
|
dtor
|
tcx
.codegen_fn_attrs
(
dtor
.did
)
.requests_inline
(),
)
});
}
tcx
.codegen_fn_attrs
(
self
.def_id
())
.requests_inline
()
...
...
compiler/rustc_middle/src/ty/query/on_disk_cache.rs
浏览文件 @
fa70398d
...
...
@@ -525,7 +525,7 @@ pub fn store_diagnostics_for_anon_node(
)
{
let
mut
current_diagnostics
=
self
.current_diagnostics
.borrow_mut
();
let
x
=
current_diagnostics
.entry
(
dep_node_index
)
.or_
insert
(
Vec
::
new
()
);
let
x
=
current_diagnostics
.entry
(
dep_node_index
)
.or_
default
(
);
x
.extend
(
Into
::
<
Vec
<
_
>>
::
into
(
diagnostics
));
}
...
...
compiler/rustc_mir/src/borrow_check/diagnostics/outlives_suggestion.rs
浏览文件 @
fa70398d
...
...
@@ -157,7 +157,7 @@ fn compile_all_suggestions(
debug!
(
"Collected {:?}: {:?}"
,
fr
,
outlived_fr
);
// Add to set of constraints for final help note.
self
.constraints_to_add
.entry
(
fr
)
.or_
insert
(
Vec
::
new
()
)
.push
(
outlived_fr
);
self
.constraints_to_add
.entry
(
fr
)
.or_
default
(
)
.push
(
outlived_fr
);
}
/// Emit an intermediate note on the given `Diagnostic` if the involved regions are
...
...
compiler/rustc_resolve/src/late.rs
浏览文件 @
fa70398d
...
...
@@ -2327,7 +2327,7 @@ fn resolve_expr(&mut self, expr: &'ast Expr, parent: Option<&'ast Expr>) {
ExprKind
::
Call
(
ref
callee
,
ref
arguments
)
=>
{
self
.resolve_expr
(
callee
,
Some
(
expr
));
let
const_args
=
self
.r
.legacy_const_generic_args
(
callee
)
.unwrap_or
(
Vec
::
new
()
);
let
const_args
=
self
.r
.legacy_const_generic_args
(
callee
)
.unwrap_or
_default
(
);
for
(
idx
,
argument
)
in
arguments
.iter
()
.enumerate
()
{
// Constant arguments need to be treated as AnonConst since
// that is how they will be later lowered to HIR.
...
...
compiler/rustc_resolve/src/late/diagnostics.rs
浏览文件 @
fa70398d
...
...
@@ -184,7 +184,7 @@ pub(crate) fn smart_resolve_report_errors(
PathResult
::
Module
(
ModuleOrUniformRoot
::
Module
(
module
))
=>
module
.res
(),
_
=>
None
,
}
.map_or
(
String
::
new
()
,
|
res
|
format!
(
"{} "
,
res
.descr
()));
.map_or
_else
(
String
::
new
,
|
res
|
format!
(
"{} "
,
res
.descr
()));
(
mod_prefix
,
format!
(
"`{}`"
,
Segment
::
names_to_string
(
mod_path
)))
};
(
...
...
@@ -1042,10 +1042,10 @@ fn smart_resolve_context_dependent_help(
if
let
Some
(
span
)
=
self
.def_span
(
def_id
)
{
err
.span_label
(
span
,
&
format!
(
"`{}` defined here"
,
path_str
));
}
let
fields
=
self
.r.field_names
.get
(
&
def_id
)
.map_or
(
"/* fields */"
.to_string
(),
|
fields
|
{
vec!
[
"_"
;
fields
.len
()]
.join
(
", "
)
}
);
let
fields
=
self
.r.field_names
.get
(
&
def_id
)
.map_or_else
(
||
"/* fields */"
.to_string
(),
|
fields
|
vec!
[
"_"
;
fields
.len
()]
.join
(
", "
),
);
err
.span_suggestion
(
span
,
"use the tuple variant pattern syntax instead"
,
...
...
library/test/src/helpers/exit_code.rs
浏览文件 @
fa70398d
...
...
@@ -4,7 +4,7 @@
#[cfg(not(unix))]
pub
fn
get_exit_code
(
status
:
ExitStatus
)
->
Result
<
i32
,
String
>
{
status
.code
()
.ok_or
(
"received no exit code from child process"
.into
())
status
.code
()
.ok_or
_else
(||
"received no exit code from child process"
.into
())
}
#[cfg(unix)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录