Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d315dc65
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,发现更多精彩内容 >>
提交
d315dc65
编写于
2月 27, 2016
作者:
L
llogiq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more check_*_post methods for LintPasses
上级
64b4b6d6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
0 deletion
+22
-0
src/librustc/lint/context.rs
src/librustc/lint/context.rs
+10
-0
src/librustc/lint/mod.rs
src/librustc/lint/mod.rs
+12
-0
未找到文件。
src/librustc/lint/context.rs
浏览文件 @
d315dc65
...
...
@@ -766,6 +766,7 @@ fn visit_foreign_item(&mut self, it: &hir::ForeignItem) {
self
.with_lint_attrs
(
&
it
.attrs
,
|
cx
|
{
run_lints!
(
cx
,
check_foreign_item
,
late_passes
,
it
);
hir_visit
::
walk_foreign_item
(
cx
,
it
);
run_lints!
(
cx
,
check_foreign_item_post
,
late_passes
,
it
);
})
}
...
...
@@ -795,6 +796,7 @@ fn visit_fn(&mut self, fk: hir_visit::FnKind<'v>, decl: &'v hir::FnDecl,
body
:
&
'v
hir
::
Block
,
span
:
Span
,
id
:
ast
::
NodeId
)
{
run_lints!
(
self
,
check_fn
,
late_passes
,
fk
,
decl
,
body
,
span
,
id
);
hir_visit
::
walk_fn
(
self
,
fk
,
decl
,
body
,
span
);
run_lints!
(
self
,
check_fn_post
,
late_passes
,
fk
,
decl
,
body
,
span
,
id
);
}
fn
visit_variant_data
(
&
mut
self
,
...
...
@@ -835,6 +837,7 @@ fn visit_name(&mut self, sp: Span, name: ast::Name) {
fn
visit_mod
(
&
mut
self
,
m
:
&
hir
::
Mod
,
s
:
Span
,
n
:
ast
::
NodeId
)
{
run_lints!
(
self
,
check_mod
,
late_passes
,
m
,
s
,
n
);
hir_visit
::
walk_mod
(
self
,
m
);
run_lints!
(
self
,
check_mod_post
,
late_passes
,
m
,
s
,
n
);
}
fn
visit_local
(
&
mut
self
,
l
:
&
hir
::
Local
)
{
...
...
@@ -874,6 +877,7 @@ fn visit_trait_item(&mut self, trait_item: &hir::TraitItem) {
run_lints!
(
cx
,
check_trait_item
,
late_passes
,
trait_item
);
cx
.visit_ids
(|
v
|
v
.visit_trait_item
(
trait_item
));
hir_visit
::
walk_trait_item
(
cx
,
trait_item
);
run_lints!
(
cx
,
check_trait_item_post
,
late_passes
,
trait_item
);
});
}
...
...
@@ -882,6 +886,7 @@ fn visit_impl_item(&mut self, impl_item: &hir::ImplItem) {
run_lints!
(
cx
,
check_impl_item
,
late_passes
,
impl_item
);
cx
.visit_ids
(|
v
|
v
.visit_impl_item
(
impl_item
));
hir_visit
::
walk_impl_item
(
cx
,
impl_item
);
run_lints!
(
cx
,
check_impl_item_post
,
late_passes
,
impl_item
);
});
}
...
...
@@ -928,6 +933,7 @@ fn visit_foreign_item(&mut self, it: &ast::ForeignItem) {
self
.with_lint_attrs
(
&
it
.attrs
,
|
cx
|
{
run_lints!
(
cx
,
check_foreign_item
,
early_passes
,
it
);
ast_visit
::
walk_foreign_item
(
cx
,
it
);
run_lints!
(
cx
,
check_foreign_item_post
,
early_passes
,
it
);
})
}
...
...
@@ -952,6 +958,7 @@ fn visit_fn(&mut self, fk: ast_visit::FnKind<'v>, decl: &'v ast::FnDecl,
body
:
&
'v
ast
::
Block
,
span
:
Span
,
id
:
ast
::
NodeId
)
{
run_lints!
(
self
,
check_fn
,
early_passes
,
fk
,
decl
,
body
,
span
,
id
);
ast_visit
::
walk_fn
(
self
,
fk
,
decl
,
body
,
span
);
run_lints!
(
self
,
check_fn_post
,
early_passes
,
fk
,
decl
,
body
,
span
,
id
);
}
fn
visit_variant_data
(
&
mut
self
,
...
...
@@ -992,6 +999,7 @@ fn visit_ident(&mut self, sp: Span, id: ast::Ident) {
fn
visit_mod
(
&
mut
self
,
m
:
&
ast
::
Mod
,
s
:
Span
,
n
:
ast
::
NodeId
)
{
run_lints!
(
self
,
check_mod
,
early_passes
,
m
,
s
,
n
);
ast_visit
::
walk_mod
(
self
,
m
);
run_lints!
(
self
,
check_mod_post
,
early_passes
,
m
,
s
,
n
);
}
fn
visit_local
(
&
mut
self
,
l
:
&
ast
::
Local
)
{
...
...
@@ -1031,6 +1039,7 @@ fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
run_lints!
(
cx
,
check_trait_item
,
early_passes
,
trait_item
);
cx
.visit_ids
(|
v
|
v
.visit_trait_item
(
trait_item
));
ast_visit
::
walk_trait_item
(
cx
,
trait_item
);
run_lints!
(
cx
,
check_trait_item_post
,
early_passes
,
trait_item
);
});
}
...
...
@@ -1039,6 +1048,7 @@ fn visit_impl_item(&mut self, impl_item: &ast::ImplItem) {
run_lints!
(
cx
,
check_impl_item
,
early_passes
,
impl_item
);
cx
.visit_ids
(|
v
|
v
.visit_impl_item
(
impl_item
));
ast_visit
::
walk_impl_item
(
cx
,
impl_item
);
run_lints!
(
cx
,
check_impl_item_post
,
early_passes
,
impl_item
);
});
}
...
...
src/librustc/lint/mod.rs
浏览文件 @
d315dc65
...
...
@@ -134,7 +134,9 @@ fn check_name(&mut self, _: &LateContext, _: Span, _: ast::Name) { }
fn
check_crate
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Crate
)
{
}
fn
check_crate_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Crate
)
{
}
fn
check_mod
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Mod
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_mod_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Mod
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_foreign_item
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
ForeignItem
)
{
}
fn
check_foreign_item_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
ForeignItem
)
{
}
fn
check_item
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Item
)
{
}
fn
check_item_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Item
)
{
}
fn
check_local
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Local
)
{
}
...
...
@@ -150,8 +152,12 @@ fn check_ty(&mut self, _: &LateContext, _: &hir::Ty) { }
fn
check_generics
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
Generics
)
{
}
fn
check_fn
(
&
mut
self
,
_
:
&
LateContext
,
_
:
FnKind
,
_
:
&
hir
::
FnDecl
,
_
:
&
hir
::
Block
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_fn_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
FnKind
,
_
:
&
hir
::
FnDecl
,
_
:
&
hir
::
Block
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_trait_item
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
TraitItem
)
{
}
fn
check_trait_item_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
TraitItem
)
{
}
fn
check_impl_item
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
ImplItem
)
{
}
fn
check_impl_item_post
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
ImplItem
)
{
}
fn
check_struct_def
(
&
mut
self
,
_
:
&
LateContext
,
_
:
&
hir
::
VariantData
,
_
:
ast
::
Name
,
_
:
&
hir
::
Generics
,
_
:
ast
::
NodeId
)
{
}
fn
check_struct_def_post
(
&
mut
self
,
_
:
&
LateContext
,
...
...
@@ -179,7 +185,9 @@ fn check_ident(&mut self, _: &EarlyContext, _: Span, _: ast::Ident) { }
fn
check_crate
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Crate
)
{
}
fn
check_crate_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Crate
)
{
}
fn
check_mod
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Mod
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_mod_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Mod
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_foreign_item
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
ForeignItem
)
{
}
fn
check_foreign_item_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
ForeignItem
)
{
}
fn
check_item
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Item
)
{
}
fn
check_item_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Item
)
{
}
fn
check_local
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Local
)
{
}
...
...
@@ -195,8 +203,12 @@ fn check_ty(&mut self, _: &EarlyContext, _: &ast::Ty) { }
fn
check_generics
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
Generics
)
{
}
fn
check_fn
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
ast_visit
::
FnKind
,
_
:
&
ast
::
FnDecl
,
_
:
&
ast
::
Block
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_fn_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
ast_visit
::
FnKind
,
_
:
&
ast
::
FnDecl
,
_
:
&
ast
::
Block
,
_
:
Span
,
_
:
ast
::
NodeId
)
{
}
fn
check_trait_item
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
TraitItem
)
{
}
fn
check_trait_item_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
TraitItem
)
{
}
fn
check_impl_item
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
ImplItem
)
{
}
fn
check_impl_item_post
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
ImplItem
)
{
}
fn
check_struct_def
(
&
mut
self
,
_
:
&
EarlyContext
,
_
:
&
ast
::
VariantData
,
_
:
ast
::
Ident
,
_
:
&
ast
::
Generics
,
_
:
ast
::
NodeId
)
{
}
fn
check_struct_def_post
(
&
mut
self
,
_
:
&
EarlyContext
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录