Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b7f87136
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,发现更多精彩内容 >>
提交
b7f87136
编写于
8月 27, 2018
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
region_infer: rustfmt
上级
8eb789f4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
17 deletion
+11
-17
src/librustc_mir/borrow_check/nll/region_infer/mod.rs
src/librustc_mir/borrow_check/nll/region_infer/mod.rs
+11
-17
未找到文件。
src/librustc_mir/borrow_check/nll/region_infer/mod.rs
浏览文件 @
b7f87136
...
...
@@ -686,7 +686,6 @@ fn try_promote_type_test<'gcx>(
test
:
_
,
}
=
type_test
;
let
generic_ty
=
generic_kind
.to_ty
(
tcx
);
let
subject
=
match
self
.try_promote_type_test_subject
(
infcx
,
generic_ty
)
{
Some
(
s
)
=>
s
,
...
...
@@ -704,11 +703,7 @@ fn try_promote_type_test<'gcx>(
debug!
(
"try_promote_type_test: non_local_ub={:?}"
,
non_local_ub
);
assert
!
(
self
.universal_regions
.is_universal_region
(
non_local_ub
));
assert
!
(
!
self
.universal_regions
.is_local_free_region
(
non_local_ub
)
);
assert
!
(
!
self
.universal_regions
.is_local_free_region
(
non_local_ub
));
let
requirement
=
ClosureOutlivesRequirement
{
subject
,
...
...
@@ -922,8 +917,7 @@ fn eval_outlives(
// now). Therefore, the sup-region outlives the sub-region if,
// for each universal region R1 in the sub-region, there
// exists some region R2 in the sup-region that outlives R1.
let
universal_outlives
=
self
.scc_values
let
universal_outlives
=
self
.scc_values
.universal_regions_outlived_by
(
sub_region_scc
)
.all
(|
r1
|
{
self
.scc_values
...
...
@@ -1034,8 +1028,7 @@ fn check_universal_region<'gcx>(
// (because `fr` includes `end(o)`).
for
shorter_fr
in
self
.scc_values
.universal_regions_outlived_by
(
longer_fr_scc
)
{
// If it is known that `fr: o`, carry on.
if
self
.universal_region_relations
if
self
.universal_region_relations
.outlives
(
longer_fr
,
shorter_fr
)
{
continue
;
...
...
@@ -1051,8 +1044,7 @@ fn check_universal_region<'gcx>(
if
let
Some
(
propagated_outlives_requirements
)
=
propagated_outlives_requirements
{
// Shrink `fr` until we find a non-local region (if we do).
// We'll call that `fr-` -- it's ever so slightly smaller than `fr`.
if
let
Some
(
fr_minus
)
=
self
.universal_region_relations
if
let
Some
(
fr_minus
)
=
self
.universal_region_relations
.non_local_lower_bound
(
longer_fr
)
{
debug!
(
"check_universal_region: fr_minus={:?}"
,
fr_minus
);
...
...
@@ -1061,8 +1053,7 @@ fn check_universal_region<'gcx>(
// region. (We always will.) We'll call that
// `shorter_fr+` -- it's ever so slightly larger than
// `fr`.
let
shorter_fr_plus
=
self
.universal_region_relations
let
shorter_fr_plus
=
self
.universal_region_relations
.non_local_upper_bound
(
shorter_fr
);
debug!
(
"check_universal_region: shorter_fr_plus={:?}"
,
...
...
@@ -1122,8 +1113,7 @@ fn check_bound_universal_region<'gcx>(
let
error_region
=
match
error_element
{
RegionElement
::
Location
(
l
)
=>
self
.find_sub_region_live_at
(
longer_fr
,
l
),
RegionElement
::
RootUniversalRegion
(
r
)
=>
r
,
RegionElement
::
SubUniversalRegion
(
error_ui
)
=>
self
.definitions
RegionElement
::
SubUniversalRegion
(
error_ui
)
=>
self
.definitions
.iter_enumerated
()
.filter_map
(|(
r
,
definition
)|
match
definition
.origin
{
NLLRegionVariableOrigin
::
BoundRegion
(
ui
)
if
error_ui
==
ui
=>
Some
(
r
),
...
...
@@ -1220,7 +1210,11 @@ fn apply_requirements(
// into a vector. These are the regions that we will be
// relating to one another.
let
closure_mapping
=
&
UniversalRegions
::
closure_mapping
(
tcx
,
user_closure_ty
,
self
.num_external_vids
,
tcx
.closure_base_def_id
(
closure_def_id
));
tcx
,
user_closure_ty
,
self
.num_external_vids
,
tcx
.closure_base_def_id
(
closure_def_id
),
);
debug!
(
"apply_requirements: closure_mapping={:?}"
,
closure_mapping
);
// Create the predicates.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录