Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ed61a64a
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
ed61a64a
编写于
9月 15, 2015
作者:
N
Nick Cameron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rebasing
上级
a642d853
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
23 deletion
+13
-23
src/librustc/lint/context.rs
src/librustc/lint/context.rs
+13
-21
src/librustc/middle/ty/mod.rs
src/librustc/middle/ty/mod.rs
+0
-2
未找到文件。
src/librustc/lint/context.rs
浏览文件 @
ed61a64a
...
...
@@ -408,8 +408,8 @@ pub trait LintContext: Sized {
fn
lints
(
&
self
)
->
&
LintStore
;
fn
mut_lints
(
&
mut
self
)
->
&
mut
LintStore
;
fn
level_stack
(
&
mut
self
)
->
&
mut
Vec
<
(
LintId
,
LevelSource
)
>
;
fn
enter_attrs
(
&
mut
self
,
attrs
:
&
[
hir
::
Attribute
]);
fn
exit_attrs
(
&
mut
self
,
attrs
:
&
[
hir
::
Attribute
]);
fn
enter_attrs
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
]);
fn
exit_attrs
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
]);
/// Get the level of `lint` at the current position of the lint
/// traversal.
...
...
@@ -510,14 +510,6 @@ fn with_lint_attrs<F>(&mut self,
self
.mut_lints
()
.set_level
(
lint
,
lvlsrc
);
}
}
fn
with_ast_lint_attrs
<
F
>
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
],
f
:
F
)
where
F
:
FnOnce
(
&
mut
Self
),
{
self
.with_lint_attrs
(
&
lower_attrs
(
attrs
),
f
)
}
}
...
...
@@ -596,11 +588,11 @@ fn level_stack(&mut self) -> &mut Vec<(LintId, LevelSource)> {
&
mut
self
.level_stack
}
fn
enter_attrs
(
&
mut
self
,
attrs
:
&
[
hir
::
Attribute
])
{
fn
enter_attrs
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
])
{
run_lints!
(
self
,
enter_lint_attrs
,
late_passes
,
attrs
);
}
fn
exit_attrs
(
&
mut
self
,
attrs
:
&
[
hir
::
Attribute
])
{
fn
exit_attrs
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
])
{
run_lints!
(
self
,
exit_lint_attrs
,
late_passes
,
attrs
);
}
}
...
...
@@ -623,11 +615,11 @@ fn level_stack(&mut self) -> &mut Vec<(LintId, LevelSource)> {
&
mut
self
.level_stack
}
fn
enter_attrs
(
&
mut
self
,
attrs
:
&
[
hir
::
Attribute
])
{
fn
enter_attrs
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
])
{
run_lints!
(
self
,
enter_lint_attrs
,
early_passes
,
attrs
);
}
fn
exit_attrs
(
&
mut
self
,
attrs
:
&
[
hir
::
Attribute
])
{
fn
exit_attrs
(
&
mut
self
,
attrs
:
&
[
ast
::
Attribute
])
{
run_lints!
(
self
,
exit_lint_attrs
,
early_passes
,
attrs
);
}
}
...
...
@@ -782,7 +774,7 @@ fn visit_attribute(&mut self, attr: &ast::Attribute) {
impl
<
'a
,
'v
>
ast_visit
::
Visitor
<
'v
>
for
EarlyContext
<
'a
>
{
fn
visit_item
(
&
mut
self
,
it
:
&
ast
::
Item
)
{
self
.with_
ast_
lint_attrs
(
&
it
.attrs
,
|
cx
|
{
self
.with_lint_attrs
(
&
it
.attrs
,
|
cx
|
{
run_lints!
(
cx
,
check_item
,
early_passes
,
it
);
cx
.visit_ids
(|
v
|
v
.visit_item
(
it
));
ast_visit
::
walk_item
(
cx
,
it
);
...
...
@@ -790,7 +782,7 @@ fn visit_item(&mut self, it: &ast::Item) {
}
fn
visit_foreign_item
(
&
mut
self
,
it
:
&
ast
::
ForeignItem
)
{
self
.with_
ast_
lint_attrs
(
&
it
.attrs
,
|
cx
|
{
self
.with_lint_attrs
(
&
it
.attrs
,
|
cx
|
{
run_lints!
(
cx
,
check_foreign_item
,
early_passes
,
it
);
ast_visit
::
walk_foreign_item
(
cx
,
it
);
})
...
...
@@ -828,14 +820,14 @@ fn visit_struct_def(&mut self,
}
fn
visit_struct_field
(
&
mut
self
,
s
:
&
ast
::
StructField
)
{
self
.with_
ast_
lint_attrs
(
&
s
.node.attrs
,
|
cx
|
{
self
.with_lint_attrs
(
&
s
.node.attrs
,
|
cx
|
{
run_lints!
(
cx
,
check_struct_field
,
early_passes
,
s
);
ast_visit
::
walk_struct_field
(
cx
,
s
);
})
}
fn
visit_variant
(
&
mut
self
,
v
:
&
ast
::
Variant
,
g
:
&
ast
::
Generics
)
{
self
.with_
ast_
lint_attrs
(
&
v
.node.attrs
,
|
cx
|
{
self
.with_lint_attrs
(
&
v
.node.attrs
,
|
cx
|
{
run_lints!
(
cx
,
check_variant
,
early_passes
,
v
,
g
);
ast_visit
::
walk_variant
(
cx
,
v
,
g
);
run_lints!
(
cx
,
check_variant_post
,
early_passes
,
v
,
g
);
...
...
@@ -886,7 +878,7 @@ fn visit_generics(&mut self, g: &ast::Generics) {
}
fn
visit_trait_item
(
&
mut
self
,
trait_item
:
&
ast
::
TraitItem
)
{
self
.with_
ast_
lint_attrs
(
&
trait_item
.attrs
,
|
cx
|
{
self
.with_lint_attrs
(
&
trait_item
.attrs
,
|
cx
|
{
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
);
...
...
@@ -894,7 +886,7 @@ fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
}
fn
visit_impl_item
(
&
mut
self
,
impl_item
:
&
ast
::
ImplItem
)
{
self
.with_
ast_
lint_attrs
(
&
impl_item
.attrs
,
|
cx
|
{
self
.with_lint_attrs
(
&
impl_item
.attrs
,
|
cx
|
{
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
);
...
...
@@ -1027,7 +1019,7 @@ pub fn check_ast_crate(sess: &Session, krate: &ast::Crate) {
let
mut
cx
=
EarlyContext
::
new
(
sess
,
krate
);
// Visit the whole crate.
cx
.with_
ast_
lint_attrs
(
&
krate
.attrs
,
|
cx
|
{
cx
.with_lint_attrs
(
&
krate
.attrs
,
|
cx
|
{
cx
.visit_id
(
ast
::
CRATE_NODE_ID
);
cx
.visit_ids
(|
v
|
{
v
.visited_outermost
=
true
;
...
...
src/librustc/middle/ty/mod.rs
浏览文件 @
ed61a64a
...
...
@@ -2089,8 +2089,6 @@ pub fn expr_is_lval(&self, expr: &hir::Expr) -> bool {
hir
::
ExprCast
(
..
)
=>
{
false
}
hir
::
ExprParen
(
ref
e
)
=>
self
.expr_is_lval
(
e
),
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录