Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4dbf9ba0
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,发现更多精彩内容 >>
提交
4dbf9ba0
编写于
6月 27, 2022
作者:
L
lcnr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
outside of borrowck, do not provide an implicit_region_bound
see comment added to the field in `VerifyBoundCx`.
上级
9cf699d2
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
18 addition
and
33 deletion
+18
-33
compiler/rustc_borrowck/src/type_check/constraint_conversion.rs
...er/rustc_borrowck/src/type_check/constraint_conversion.rs
+3
-3
compiler/rustc_borrowck/src/type_check/free_region_relations.rs
...er/rustc_borrowck/src/type_check/free_region_relations.rs
+2
-2
compiler/rustc_borrowck/src/type_check/input_output.rs
compiler/rustc_borrowck/src/type_check/input_output.rs
+1
-1
compiler/rustc_borrowck/src/type_check/mod.rs
compiler/rustc_borrowck/src/type_check/mod.rs
+2
-2
compiler/rustc_infer/src/infer/outlives/obligations.rs
compiler/rustc_infer/src/infer/outlives/obligations.rs
+2
-11
compiler/rustc_infer/src/infer/outlives/verify.rs
compiler/rustc_infer/src/infer/outlives/verify.rs
+5
-0
compiler/rustc_trait_selection/src/traits/auto_trait.rs
compiler/rustc_trait_selection/src/traits/auto_trait.rs
+1
-1
compiler/rustc_trait_selection/src/traits/coherence.rs
compiler/rustc_trait_selection/src/traits/coherence.rs
+1
-5
compiler/rustc_typeck/src/check/regionck.rs
compiler/rustc_typeck/src/check/regionck.rs
+0
-1
compiler/rustc_typeck/src/check/wfcheck.rs
compiler/rustc_typeck/src/check/wfcheck.rs
+1
-7
未找到文件。
compiler/rustc_borrowck/src/type_check/constraint_conversion.rs
浏览文件 @
4dbf9ba0
...
...
@@ -23,7 +23,7 @@ pub(crate) struct ConstraintConversion<'a, 'tcx> {
tcx
:
TyCtxt
<
'tcx
>
,
universal_regions
:
&
'a
UniversalRegions
<
'tcx
>
,
region_bound_pairs
:
&
'a
RegionBoundPairs
<
'tcx
>
,
implicit_region_bound
:
Option
<
ty
::
Region
<
'tcx
>
>
,
implicit_region_bound
:
ty
::
Region
<
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
locations
:
Locations
,
span
:
Span
,
...
...
@@ -36,7 +36,7 @@ pub(crate) fn new(
infcx
:
&
'a
InferCtxt
<
'a
,
'tcx
>
,
universal_regions
:
&
'a
UniversalRegions
<
'tcx
>
,
region_bound_pairs
:
&
'a
RegionBoundPairs
<
'tcx
>
,
implicit_region_bound
:
Option
<
ty
::
Region
<
'tcx
>
>
,
implicit_region_bound
:
ty
::
Region
<
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
locations
:
Locations
,
span
:
Span
,
...
...
@@ -120,7 +120,7 @@ pub(super) fn convert(&mut self, query_constraint: &QueryOutlivesConstraint<'tcx
&
mut
*
self
,
tcx
,
region_bound_pairs
,
implicit_region_bound
,
Some
(
implicit_region_bound
)
,
param_env
,
)
.type_must_outlive
(
origin
,
t1
,
r2
);
...
...
compiler/rustc_borrowck/src/type_check/free_region_relations.rs
浏览文件 @
4dbf9ba0
...
...
@@ -61,7 +61,7 @@ pub(crate) struct CreateResult<'tcx> {
pub
(
crate
)
fn
create
<
'tcx
>
(
infcx
:
&
InferCtxt
<
'_
,
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
implicit_region_bound
:
Option
<
ty
::
Region
<
'tcx
>
>
,
implicit_region_bound
:
ty
::
Region
<
'tcx
>
,
universal_regions
:
&
Rc
<
UniversalRegions
<
'tcx
>>
,
constraints
:
&
mut
MirTypeckRegionConstraints
<
'tcx
>
,
)
->
CreateResult
<
'tcx
>
{
...
...
@@ -223,7 +223,7 @@ struct UniversalRegionRelationsBuilder<'this, 'tcx> {
infcx
:
&
'this
InferCtxt
<
'this
,
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
universal_regions
:
Rc
<
UniversalRegions
<
'tcx
>>
,
implicit_region_bound
:
Option
<
ty
::
Region
<
'tcx
>
>
,
implicit_region_bound
:
ty
::
Region
<
'tcx
>
,
constraints
:
&
'this
mut
MirTypeckRegionConstraints
<
'tcx
>
,
// outputs:
...
...
compiler/rustc_borrowck/src/type_check/input_output.rs
浏览文件 @
4dbf9ba0
...
...
@@ -230,7 +230,7 @@ pub(crate) fn normalize_and_add_constraints(&mut self, t: Ty<'tcx>) -> Fallible<
self
.infcx
,
&
self
.borrowck_context.universal_regions
,
&
self
.region_bound_pairs
,
Some
(
self
.implicit_region_bound
)
,
self
.implicit_region_bound
,
self
.param_env
,
Locations
::
All
(
DUMMY_SP
),
DUMMY_SP
,
...
...
compiler/rustc_borrowck/src/type_check/mod.rs
浏览文件 @
4dbf9ba0
...
...
@@ -157,7 +157,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
}
=
free_region_relations
::
create
(
infcx
,
param_env
,
Some
(
implicit_region_bound
)
,
implicit_region_bound
,
universal_regions
,
&
mut
constraints
,
);
...
...
@@ -1142,7 +1142,7 @@ fn push_region_constraints(
self
.infcx
,
self
.borrowck_context.universal_regions
,
self
.region_bound_pairs
,
Some
(
self
.implicit_region_bound
)
,
self
.implicit_region_bound
,
self
.param_env
,
locations
,
locations
.span
(
self
.body
),
...
...
compiler/rustc_infer/src/infer/outlives/obligations.rs
浏览文件 @
4dbf9ba0
...
...
@@ -141,9 +141,6 @@ pub fn take_registered_region_obligations(&self) -> Vec<(hir::HirId, RegionOblig
/// `('a, K)` in this list tells us that the bounds in scope
/// indicate that `K: 'a`, where `K` is either a generic
/// parameter like `T` or a projection like `T::Item`.
/// - `implicit_region_bound`: if some, this is a region bound
/// that is considered to hold for all type parameters (the
/// function body).
/// - `param_env` is the parameter environment for the enclosing function.
/// - `body_id` is the body-id whose region obligations are being
/// processed.
...
...
@@ -151,7 +148,6 @@ pub fn take_registered_region_obligations(&self) -> Vec<(hir::HirId, RegionOblig
pub
fn
process_registered_region_obligations
(
&
self
,
region_bound_pairs_map
:
&
FxHashMap
<
hir
::
HirId
,
RegionBoundPairs
<
'tcx
>>
,
implicit_region_bound
:
Option
<
ty
::
Region
<
'tcx
>>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
)
{
assert
!
(
...
...
@@ -170,13 +166,8 @@ pub fn process_registered_region_obligations(
let
sup_type
=
self
.resolve_vars_if_possible
(
sup_type
);
if
let
Some
(
region_bound_pairs
)
=
region_bound_pairs_map
.get
(
&
body_id
)
{
let
outlives
=
&
mut
TypeOutlives
::
new
(
self
,
self
.tcx
,
&
region_bound_pairs
,
implicit_region_bound
,
param_env
,
);
let
outlives
=
&
mut
TypeOutlives
::
new
(
self
,
self
.tcx
,
&
region_bound_pairs
,
None
,
param_env
);
outlives
.type_must_outlive
(
origin
,
sup_type
,
sub_region
);
}
else
{
self
.tcx.sess
.delay_span_bug
(
...
...
compiler/rustc_infer/src/infer/outlives/verify.rs
浏览文件 @
4dbf9ba0
...
...
@@ -16,6 +16,11 @@
pub
struct
VerifyBoundCx
<
'cx
,
'tcx
>
{
tcx
:
TyCtxt
<
'tcx
>
,
region_bound_pairs
:
&
'cx
RegionBoundPairs
<
'tcx
>
,
/// During borrowck, if there are no outlives bounds on a generic
/// parameter `T`, we assume that `T: 'in_fn_body` holds.
///
/// Outside of borrowck the only way to prove `T: '?0` is by
/// setting `'?0` to `'empty`.
implicit_region_bound
:
Option
<
ty
::
Region
<
'tcx
>>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
}
...
...
compiler/rustc_trait_selection/src/traits/auto_trait.rs
浏览文件 @
4dbf9ba0
...
...
@@ -220,7 +220,7 @@ pub fn find_auto_trait_generics<A>(
.map
(|
&
(
id
,
_
)|
(
id
,
vec!
[]))
.collect
();
infcx
.process_registered_region_obligations
(
&
body_id_map
,
None
,
full_env
);
infcx
.process_registered_region_obligations
(
&
body_id_map
,
full_env
);
let
region_data
=
infcx
.inner
...
...
compiler/rustc_trait_selection/src/traits/coherence.rs
浏览文件 @
4dbf9ba0
...
...
@@ -407,11 +407,7 @@ fn resolve_negative_obligation<'cx, 'tcx>(
// function bodies with closures).
outlives_env
.save_implied_bounds
(
CRATE_HIR_ID
);
infcx
.process_registered_region_obligations
(
outlives_env
.region_bound_pairs_map
(),
Some
(
tcx
.lifetimes.re_root_empty
),
param_env
,
);
infcx
.process_registered_region_obligations
(
outlives_env
.region_bound_pairs_map
(),
param_env
);
let
errors
=
infcx
.resolve_regions
(
region_context
,
&
outlives_env
);
...
...
compiler/rustc_typeck/src/check/regionck.rs
浏览文件 @
4dbf9ba0
...
...
@@ -366,7 +366,6 @@ fn visit_region_obligations(&mut self, hir_id: hir::HirId) {
fn
resolve_regions_and_report_errors
(
&
self
)
{
self
.infcx
.process_registered_region_obligations
(
self
.outlives_environment
.region_bound_pairs_map
(),
Some
(
self
.tcx.lifetimes.re_root_empty
),
self
.param_env
,
);
...
...
compiler/rustc_typeck/src/check/wfcheck.rs
浏览文件 @
4dbf9ba0
...
...
@@ -596,13 +596,7 @@ fn ty_known_to_outlive<'tcx>(
)
->
bool
{
resolve_regions_with_wf_tys
(
tcx
,
id
,
param_env
,
&
wf_tys
,
|
infcx
,
region_bound_pairs
|
{
let
origin
=
infer
::
RelateParamBound
(
DUMMY_SP
,
ty
,
None
);
let
outlives
=
&
mut
TypeOutlives
::
new
(
infcx
,
tcx
,
region_bound_pairs
,
Some
(
infcx
.tcx.lifetimes.re_root_empty
),
param_env
,
);
let
outlives
=
&
mut
TypeOutlives
::
new
(
infcx
,
tcx
,
region_bound_pairs
,
None
,
param_env
);
outlives
.type_must_outlive
(
origin
,
ty
,
region
);
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录