Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
44a0522b
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,发现更多精彩内容 >>
提交
44a0522b
编写于
12月 20, 2017
作者:
M
Michael Woerister
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
incr.comp.: Use ensure() for some coherence-related queries.
上级
dba52ced
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
15 deletion
+10
-15
src/librustc/ty/maps/config.rs
src/librustc/ty/maps/config.rs
+1
-1
src/librustc/ty/maps/mod.rs
src/librustc/ty/maps/mod.rs
+1
-5
src/librustc/ty/util.rs
src/librustc/ty/util.rs
+2
-2
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/coherence/mod.rs
+6
-7
未找到文件。
src/librustc/ty/maps/config.rs
浏览文件 @
44a0522b
...
...
@@ -102,7 +102,7 @@ fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
}
impl
<
'tcx
>
QueryDescription
<
'tcx
>
for
queries
::
coherent_trait
<
'tcx
>
{
fn
describe
(
tcx
:
TyCtxt
,
(
_
,
def_id
):
(
CrateNum
,
DefId
)
)
->
String
{
fn
describe
(
tcx
:
TyCtxt
,
def_id
:
DefId
)
->
String
{
format!
(
"coherence checking all impls of trait `{}`"
,
tcx
.item_path_str
(
def_id
))
}
...
...
src/librustc/ty/maps/mod.rs
浏览文件 @
44a0522b
...
...
@@ -187,7 +187,7 @@
[]
fn
has_typeck_tables
:
HasTypeckTables
(
DefId
)
->
bool
,
[]
fn
coherent_trait
:
coherent_trait_dep_node
((
CrateNum
,
DefId
)
)
->
(),
[]
fn
coherent_trait
:
CoherenceCheckTrait
(
DefId
)
->
(),
[]
fn
borrowck
:
BorrowCheck
(
DefId
)
->
Rc
<
BorrowCheckResult
>
,
...
...
@@ -385,10 +385,6 @@ fn fulfill_obligation_dep_node<'tcx>((param_env, trait_ref):
}
}
fn
coherent_trait_dep_node
<
'tcx
>
((
_
,
def_id
):
(
CrateNum
,
DefId
))
->
DepConstructor
<
'tcx
>
{
DepConstructor
::
CoherenceCheckTrait
(
def_id
)
}
fn
crate_inherent_impls_dep_node
<
'tcx
>
(
_
:
CrateNum
)
->
DepConstructor
<
'tcx
>
{
DepConstructor
::
Coherence
}
...
...
src/librustc/ty/util.rs
浏览文件 @
44a0522b
...
...
@@ -11,7 +11,7 @@
//! misc. type-system utilities too small to deserve their own file
use
hir
::
def
::
Def
;
use
hir
::
def_id
::
{
DefId
,
LOCAL_CRATE
}
;
use
hir
::
def_id
::
DefId
;
use
hir
::
map
::{
DefPathData
,
Node
};
use
hir
;
use
ich
::
NodeIdHashingMode
;
...
...
@@ -427,7 +427,7 @@ pub fn calculate_dtor(
return
None
;
};
self
.coherent_trait
((
LOCAL_CRATE
,
drop_trait
)
);
ty
::
maps
::
queries
::
coherent_trait
::
ensure
(
self
,
drop_trait
);
let
mut
dtor_did
=
None
;
let
ty
=
self
.type_of
(
adt_did
);
...
...
src/librustc_typeck/coherence/mod.rs
浏览文件 @
44a0522b
...
...
@@ -15,8 +15,8 @@
// done by the orphan and overlap modules. Then we build up various
// mappings. That mapping code resides here.
use
hir
::
def_id
::{
CrateNum
,
DefId
,
LOCAL_CRATE
};
use
rustc
::
ty
::{
TyCtxt
,
TypeFoldable
};
use
hir
::
def_id
::{
DefId
,
LOCAL_CRATE
};
use
rustc
::
ty
::{
self
,
TyCtxt
,
TypeFoldable
};
use
rustc
::
ty
::
maps
::
Providers
;
use
syntax
::
ast
;
...
...
@@ -113,8 +113,7 @@ pub fn provide(providers: &mut Providers) {
};
}
fn
coherent_trait
<
'a
,
'tcx
>
(
tcx
:
TyCtxt
<
'a
,
'tcx
,
'tcx
>
,
(
_
,
def_id
):
(
CrateNum
,
DefId
))
{
fn
coherent_trait
<
'a
,
'tcx
>
(
tcx
:
TyCtxt
<
'a
,
'tcx
,
'tcx
>
,
def_id
:
DefId
)
{
let
impls
=
tcx
.hir
.trait_impls
(
def_id
);
for
&
impl_id
in
impls
{
check_impl
(
tcx
,
impl_id
);
...
...
@@ -127,7 +126,7 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
pub
fn
check_coherence
<
'a
,
'tcx
>
(
tcx
:
TyCtxt
<
'a
,
'tcx
,
'tcx
>
)
{
for
&
trait_def_id
in
tcx
.hir
.krate
()
.trait_impls
.keys
()
{
t
cx
.coherent_trait
((
LOCAL_CRATE
,
trait_def_id
)
);
t
y
::
maps
::
queries
::
coherent_trait
::
ensure
(
tcx
,
trait_def_id
);
}
unsafety
::
check
(
tcx
);
...
...
@@ -135,6 +134,6 @@ pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
overlap
::
check_auto_impls
(
tcx
);
// these queries are executed for side-effects (error reporting):
t
cx
.crate_inherent_impls
(
LOCAL_CRATE
);
t
cx
.crate_inherent_impls_overlap_check
(
LOCAL_CRATE
);
t
y
::
maps
::
queries
::
crate_inherent_impls
::
ensure
(
tcx
,
LOCAL_CRATE
);
t
y
::
maps
::
queries
::
crate_inherent_impls_overlap_check
::
ensure
(
tcx
,
LOCAL_CRATE
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录