Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
55f81bce
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,发现更多精彩内容 >>
提交
55f81bce
编写于
1月 09, 2014
作者:
B
Brian Anderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc: Fix style of Lint enum
上级
520c82e0
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
124 addition
and
124 deletion
+124
-124
src/librustc/driver/session.rs
src/librustc/driver/session.rs
+5
-5
src/librustc/front/feature_gate.rs
src/librustc/front/feature_gate.rs
+1
-1
src/librustc/middle/dead.rs
src/librustc/middle/dead.rs
+2
-2
src/librustc/middle/lint.rs
src/librustc/middle/lint.rs
+105
-105
src/librustc/middle/liveness.rs
src/librustc/middle/liveness.rs
+4
-4
src/librustc/middle/resolve.rs
src/librustc/middle/resolve.rs
+4
-4
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/check/mod.rs
+3
-3
未找到文件。
src/librustc/driver/session.rs
浏览文件 @
55f81bce
...
...
@@ -145,7 +145,7 @@ pub struct options {
llvm_args
:
~
[
~
str
],
debuginfo
:
bool
,
extra_debuginfo
:
bool
,
lint_opts
:
~
[(
lint
::
l
int
,
lint
::
level
)],
lint_opts
:
~
[(
lint
::
L
int
,
lint
::
level
)],
save_temps
:
bool
,
output_type
:
back
::
link
::
OutputType
,
// This is mutable for rustpkg, which updates search paths based on the
...
...
@@ -214,7 +214,7 @@ pub struct Session_ {
building_library
:
Cell
<
bool
>
,
working_dir
:
Path
,
lints
:
RefCell
<
HashMap
<
ast
::
NodeId
,
~
[(
lint
::
l
int
,
codemap
::
Span
,
~
str
)]
>>
,
~
[(
lint
::
L
int
,
codemap
::
Span
,
~
str
)]
>>
,
node_id
:
Cell
<
ast
::
NodeId
>
,
outputs
:
@
RefCell
<~
[
OutputStyle
]
>
,
}
...
...
@@ -268,7 +268,7 @@ pub fn unimpl(&self, msg: &str) -> ! {
self
.span_diagnostic
.handler
()
.unimpl
(
msg
)
}
pub
fn
add_lint
(
&
self
,
lint
:
lint
::
l
int
,
lint
:
lint
::
L
int
,
id
:
ast
::
NodeId
,
sp
:
Span
,
msg
:
~
str
)
{
...
...
@@ -443,12 +443,12 @@ pub fn collect_outputs(session: &Session,
Some
(
n
)
if
"staticlib"
==
n
=>
Some
(
OutputStaticlib
),
Some
(
n
)
if
"bin"
==
n
=>
Some
(
OutputExecutable
),
Some
(
_
)
=>
{
session
.add_lint
(
lint
::
unknown_crate_t
ype
,
ast
::
CRATE_NODE_ID
,
session
.add_lint
(
lint
::
UnknownCrateT
ype
,
ast
::
CRATE_NODE_ID
,
a
.span
,
~
"invalid `crate_type` value"
);
None
}
_
=>
{
session
.add_lint
(
lint
::
unknown_crate_t
ype
,
ast
::
CRATE_NODE_ID
,
session
.add_lint
(
lint
::
UnknownCrateT
ype
,
ast
::
CRATE_NODE_ID
,
a
.span
,
~
"`crate_type` requires a value"
);
None
}
...
...
src/librustc/front/feature_gate.rs
浏览文件 @
55f81bce
...
...
@@ -233,7 +233,7 @@ pub fn check_crate(sess: Session, crate: &ast::Crate) {
directive not necessary"
);
}
None
=>
{
sess
.add_lint
(
lint
::
unknown_f
eatures
,
sess
.add_lint
(
lint
::
UnknownF
eatures
,
ast
::
CRATE_NODE_ID
,
mi
.span
,
~
"unknown feature"
);
...
...
src/librustc/middle/dead.rs
浏览文件 @
55f81bce
...
...
@@ -15,7 +15,7 @@
use
middle
::
ty
;
use
middle
::
typeck
;
use
middle
::
privacy
;
use
middle
::
lint
::
dead_c
ode
;
use
middle
::
lint
::
DeadC
ode
;
use
std
::
hashmap
::
HashSet
;
use
syntax
::
ast
;
...
...
@@ -328,7 +328,7 @@ fn symbol_is_live(&mut self, id: ast::NodeId,
fn
warn_dead_code
(
&
mut
self
,
id
:
ast
::
NodeId
,
span
:
codemap
::
Span
,
ident
:
&
ast
::
Ident
)
{
self
.tcx.sess
.add_lint
(
dead_c
ode
,
id
,
span
,
self
.tcx.sess
.add_lint
(
DeadC
ode
,
id
,
span
,
format!
(
"code is never used: `{}`"
,
token
::
ident_to_str
(
ident
)));
}
...
...
src/librustc/middle/lint.rs
浏览文件 @
55f81bce
此差异已折叠。
点击以展开。
src/librustc/middle/liveness.rs
浏览文件 @
55f81bce
...
...
@@ -103,7 +103,7 @@
*/
use
middle
::
lint
::{
unused_variable
,
dead_a
ssignment
};
use
middle
::
lint
::{
UnusedVariable
,
DeadA
ssignment
};
use
middle
::
pat_util
;
use
middle
::
ty
;
use
middle
::
typeck
;
...
...
@@ -1705,11 +1705,11 @@ pub fn warn_about_unused(&self,
};
if
is_assigned
{
self
.tcx.sess
.add_lint
(
unused_v
ariable
,
id
,
sp
,
self
.tcx.sess
.add_lint
(
UnusedV
ariable
,
id
,
sp
,
format!
(
"variable `{}` is assigned to,
\
but never used"
,
*
name
));
}
else
{
self
.tcx.sess
.add_lint
(
unused_v
ariable
,
id
,
sp
,
self
.tcx.sess
.add_lint
(
UnusedV
ariable
,
id
,
sp
,
format!
(
"unused variable: `{}`"
,
*
name
));
}
}
...
...
@@ -1727,7 +1727,7 @@ pub fn warn_about_dead_assign(&self,
if
self
.live_on_exit
(
ln
,
var
)
.is_none
()
{
let
r
=
self
.should_warn
(
var
);
for
name
in
r
.iter
()
{
self
.tcx.sess
.add_lint
(
dead_a
ssignment
,
id
,
sp
,
self
.tcx.sess
.add_lint
(
DeadA
ssignment
,
id
,
sp
,
format!
(
"value assigned to `{}` is never read"
,
*
name
));
}
}
...
...
src/librustc/middle/resolve.rs
浏览文件 @
55f81bce
...
...
@@ -13,7 +13,7 @@
use
metadata
::
csearch
;
use
metadata
::
decoder
::{
DefLike
,
DlDef
,
DlField
,
DlImpl
};
use
middle
::
lang_items
::
LanguageItems
;
use
middle
::
lint
::{
unnecessary_qualification
,
unused_i
mports
};
use
middle
::
lint
::{
UnnecessaryQualification
,
UnusedI
mports
};
use
middle
::
pat_util
::
pat_bindings
;
use
syntax
::
ast
::
*
;
...
...
@@ -4735,7 +4735,7 @@ fn resolve_path(&mut self,
let
def
=
self
.resolve_module_relative_path
(
path
,
namespace
);
match
(
def
,
unqualified_def
)
{
(
Some
((
d
,
_
)),
Some
((
ud
,
_
)))
if
d
==
ud
=>
{
self
.session
.add_lint
(
unnecessary_q
ualification
,
self
.session
.add_lint
(
UnnecessaryQ
ualification
,
id
,
path
.span
,
~
"unnecessary qualification"
);
...
...
@@ -5557,7 +5557,7 @@ fn check_for_item_unused_imports(&self, vi: &ViewItem) {
match
p
.node
{
ViewPathSimple
(
_
,
_
,
id
)
|
ViewPathGlob
(
_
,
id
)
=>
{
if
!
self
.used_imports
.contains
(
&
id
)
{
self
.session
.add_lint
(
unused_i
mports
,
self
.session
.add_lint
(
UnusedI
mports
,
id
,
p
.span
,
~
"unused import"
);
}
...
...
@@ -5566,7 +5566,7 @@ fn check_for_item_unused_imports(&self, vi: &ViewItem) {
ViewPathList
(
_
,
ref
list
,
_
)
=>
{
for
i
in
list
.iter
()
{
if
!
self
.used_imports
.contains
(
&
i
.node.id
)
{
self
.session
.add_lint
(
unused_i
mports
,
self
.session
.add_lint
(
UnusedI
mports
,
i
.node.id
,
i
.span
,
~
"unused import"
);
}
...
...
src/librustc/middle/typeck/check/mod.rs
浏览文件 @
55f81bce
...
...
@@ -80,7 +80,7 @@
use
middle
::
const_eval
;
use
middle
::
lang_items
::{
ExchangeHeapLangItem
,
GcLangItem
};
use
middle
::
lang_items
::{
ManagedHeapLangItem
};
use
middle
::
lint
::
unreachable_c
ode
;
use
middle
::
lint
::
UnreachableC
ode
;
use
middle
::
pat_util
::
pat_id_map
;
use
middle
::
pat_util
;
use
middle
::
subst
::
Subst
;
...
...
@@ -3491,7 +3491,7 @@ pub fn check_block_with_expected(fcx: @FnCtxt,
}
_
=>
false
}
{
fcx
.ccx.tcx.sess
.add_lint
(
unreachable_c
ode
,
s_id
,
s
.span
,
fcx
.ccx.tcx.sess
.add_lint
(
UnreachableC
ode
,
s_id
,
s
.span
,
~
"unreachable statement"
);
warned
=
true
;
}
...
...
@@ -3513,7 +3513,7 @@ pub fn check_block_with_expected(fcx: @FnCtxt,
},
Some
(
e
)
=>
{
if
any_bot
&&
!
warned
{
fcx
.ccx.tcx.sess
.add_lint
(
unreachable_c
ode
,
e
.id
,
e
.span
,
fcx
.ccx.tcx.sess
.add_lint
(
UnreachableC
ode
,
e
.id
,
e
.span
,
~
"unreachable expression"
);
}
check_expr_with_opt_hint
(
fcx
,
e
,
expected
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录