Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
f975d051
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,发现更多精彩内容 >>
提交
f975d051
编写于
5月 07, 2022
作者:
M
Miguel Guarniz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename visit item-like methods
Signed-off-by:
N
Miguel Guarniz
<
mi9uel9@gmail.com
>
上级
7e44078e
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
23 addition
and
20 deletion
+23
-20
compiler/rustc_hir/src/intravisit.rs
compiler/rustc_hir/src/intravisit.rs
+1
-1
compiler/rustc_incremental/src/assert_dep_graph.rs
compiler/rustc_incremental/src/assert_dep_graph.rs
+1
-1
compiler/rustc_metadata/src/rmeta/encoder.rs
compiler/rustc_metadata/src/rmeta/encoder.rs
+1
-1
compiler/rustc_middle/src/hir/map/mod.rs
compiler/rustc_middle/src/hir/map/mod.rs
+11
-8
compiler/rustc_mir_transform/src/lib.rs
compiler/rustc_mir_transform/src/lib.rs
+1
-1
compiler/rustc_passes/src/check_attr.rs
compiler/rustc_passes/src/check_attr.rs
+1
-1
compiler/rustc_passes/src/intrinsicck.rs
compiler/rustc_passes/src/intrinsicck.rs
+1
-1
compiler/rustc_passes/src/liveness.rs
compiler/rustc_passes/src/liveness.rs
+1
-1
compiler/rustc_passes/src/loops.rs
compiler/rustc_passes/src/loops.rs
+1
-1
compiler/rustc_passes/src/naked_functions.rs
compiler/rustc_passes/src/naked_functions.rs
+1
-1
compiler/rustc_passes/src/stability.rs
compiler/rustc_passes/src/stability.rs
+2
-2
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/collect.rs
+1
-1
未找到文件。
compiler/rustc_hir/src/intravisit.rs
浏览文件 @
f975d051
...
...
@@ -19,7 +19,7 @@
//! - Example: Examine each expression to look for its type and do some check or other.
//! - How: Implement `intravisit::Visitor` and override the `NestedFilter` type to
//! `nested_filter::OnlyBodies` (and implement `nested_visit_map`), and use
//! `tcx.hir().visit_all_item_likes(&mut visitor)`. Within your
//! `tcx.hir().
deep_
visit_all_item_likes(&mut visitor)`. Within your
//! `intravisit::Visitor` impl, implement methods like `visit_expr()` (don't forget to invoke
//! `intravisit::walk_expr()` to keep walking the subparts).
//! - Pro: Visitor methods for any kind of HIR node, not just item-like things.
...
...
compiler/rustc_incremental/src/assert_dep_graph.rs
浏览文件 @
f975d051
...
...
@@ -75,7 +75,7 @@ pub fn assert_dep_graph(tcx: TyCtxt<'_>) {
let
mut
visitor
=
IfThisChanged
{
tcx
,
if_this_changed
:
vec!
[],
then_this_would_need
:
vec!
[]
};
visitor
.process_attrs
(
hir
::
CRATE_HIR_ID
);
tcx
.hir
()
.visit_all_item_likes
(
&
mut
visitor
);
tcx
.hir
()
.
deep_
visit_all_item_likes
(
&
mut
visitor
);
(
visitor
.if_this_changed
,
visitor
.then_this_would_need
)
};
...
...
compiler/rustc_metadata/src/rmeta/encoder.rs
浏览文件 @
f975d051
...
...
@@ -452,7 +452,7 @@ fn encode_info_for_items(&mut self) {
return
;
}
self
.tcx
.hir
()
.visit_all_item_likes
(
self
);
self
.tcx
.hir
()
.
deep_
visit_all_item_likes
(
self
);
}
fn
encode_def_path_table
(
&
mut
self
)
{
...
...
compiler/rustc_middle/src/hir/map/mod.rs
浏览文件 @
f975d051
...
...
@@ -606,14 +606,14 @@ pub fn walk_attributes(self, visitor: &mut impl Visitor<'hir>) {
}
/// Visits all items in the crate in some deterministic (but
/// unspecified) order. If you just need to process every item,
/// but don't care about nesting, this method is the best choice.
/// unspecified) order. If you need to process every item,
/// and care about nesting -- usually because your algorithm
/// follows lexical scoping rules -- then this method is the best choice.
/// If you don't care about nesting, you should use the `tcx.hir_crate_items()` query
/// or `items()` instead.
///
/// If you do care about nesting -- usually because your algorithm
/// follows lexical scoping rules -- then you want a different
/// approach. You should override `visit_nested_item` in your
/// visitor and then call `intravisit::walk_crate` instead.
pub
fn
visit_all_item_likes
<
V
>
(
self
,
visitor
:
&
mut
V
)
/// Please see the notes in `intravisit.rs` for more information.
pub
fn
deep_visit_all_item_likes
<
V
>
(
self
,
visitor
:
&
mut
V
)
where
V
:
Visitor
<
'hir
>
,
{
...
...
@@ -646,7 +646,10 @@ pub fn par_visit_all_item_likes<V>(self, visitor: &V)
})
}
pub
fn
visit_item_likes_in_module
<
V
>
(
self
,
module
:
LocalDefId
,
visitor
:
&
mut
V
)
/// If you don't care about nesting, you should use the
/// `tcx.hir_module_items()` query or `module_items()` instead.
/// Please see notes in `deep_visit_all_item_likes`.
pub
fn
deep_visit_item_likes_in_module
<
V
>
(
self
,
module
:
LocalDefId
,
visitor
:
&
mut
V
)
where
V
:
Visitor
<
'hir
>
,
{
...
...
compiler/rustc_mir_transform/src/lib.rs
浏览文件 @
f975d051
...
...
@@ -170,7 +170,7 @@ fn visit_variant_data(
intravisit
::
walk_struct_def
(
self
,
v
)
}
}
tcx
.hir
()
.visit_all_item_likes
(
&
mut
GatherCtors
{
tcx
,
set
:
&
mut
set
});
tcx
.hir
()
.
deep_
visit_all_item_likes
(
&
mut
GatherCtors
{
tcx
,
set
:
&
mut
set
});
set
}
...
...
compiler/rustc_passes/src/check_attr.rs
浏览文件 @
f975d051
...
...
@@ -2384,7 +2384,7 @@ fn check_non_exported_macro_for_invalid_attrs(tcx: TyCtxt<'_>, item: &Item<'_>)
fn
check_mod_attrs
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
let
check_attr_visitor
=
&
mut
CheckAttrVisitor
{
tcx
};
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
check_attr_visitor
);
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
check_attr_visitor
);
if
module_def_id
.is_top_level_module
()
{
check_attr_visitor
.check_attributes
(
CRATE_HIR_ID
,
DUMMY_SP
,
Target
::
Mod
,
None
);
check_invalid_crate_level_attr
(
tcx
,
tcx
.hir
()
.krate_attrs
());
...
...
compiler/rustc_passes/src/intrinsicck.rs
浏览文件 @
f975d051
...
...
@@ -17,7 +17,7 @@
use
rustc_target
::
spec
::
abi
::
Abi
::
RustIntrinsic
;
fn
check_mod_intrinsics
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
&
mut
ItemVisitor
{
tcx
});
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
&
mut
ItemVisitor
{
tcx
});
}
pub
fn
provide
(
providers
:
&
mut
Providers
)
{
...
...
compiler/rustc_passes/src/liveness.rs
浏览文件 @
f975d051
...
...
@@ -140,7 +140,7 @@ fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_>) -> String {
}
fn
check_mod_liveness
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
&
mut
IrMaps
::
new
(
tcx
));
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
&
mut
IrMaps
::
new
(
tcx
));
}
pub
fn
provide
(
providers
:
&
mut
Providers
)
{
...
...
compiler/rustc_passes/src/loops.rs
浏览文件 @
f975d051
...
...
@@ -31,7 +31,7 @@ struct CheckLoopVisitor<'a, 'hir> {
}
fn
check_mod_loops
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
&
mut
CheckLoopVisitor
{
sess
:
&
tcx
.sess
,
hir_map
:
tcx
.hir
(),
cx
:
Normal
},
);
...
...
compiler/rustc_passes/src/naked_functions.rs
浏览文件 @
f975d051
...
...
@@ -14,7 +14,7 @@
use
rustc_target
::
spec
::
abi
::
Abi
;
fn
check_mod_naked_functions
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
&
mut
CheckNakedFunctions
{
tcx
});
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
&
mut
CheckNakedFunctions
{
tcx
});
}
crate
fn
provide
(
providers
:
&
mut
Providers
)
{
...
...
compiler/rustc_passes/src/stability.rs
浏览文件 @
f975d051
...
...
@@ -661,7 +661,7 @@ fn stability_index(tcx: TyCtxt<'_>, (): ()) -> Index {
/// Cross-references the feature names of unstable APIs with enabled
/// features and possibly prints errors.
fn
check_mod_unstable_api_usage
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
&
mut
Checker
{
tcx
});
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
&
mut
Checker
{
tcx
});
}
pub
(
crate
)
fn
provide
(
providers
:
&
mut
Providers
)
{
...
...
@@ -837,7 +837,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
let
mut
missing
=
MissingStabilityAnnotations
{
tcx
,
access_levels
};
missing
.check_missing_stability
(
CRATE_DEF_ID
,
tcx
.hir
()
.span
(
CRATE_HIR_ID
));
tcx
.hir
()
.walk_toplevel_module
(
&
mut
missing
);
tcx
.hir
()
.visit_all_item_likes
(
&
mut
missing
);
tcx
.hir
()
.
deep_
visit_all_item_likes
(
&
mut
missing
);
}
let
declared_lang_features
=
&
tcx
.features
()
.declared_lang_features
;
...
...
compiler/rustc_typeck/src/collect.rs
浏览文件 @
f975d051
...
...
@@ -59,7 +59,7 @@
// Main entry point
fn
collect_mod_item_types
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
LocalDefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
&
mut
CollectItemTypesVisitor
{
tcx
});
tcx
.hir
()
.
deep_
visit_item_likes_in_module
(
module_def_id
,
&
mut
CollectItemTypesVisitor
{
tcx
});
}
pub
fn
provide
(
providers
:
&
mut
Providers
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录