Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c1084a3a
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,发现更多精彩内容 >>
提交
c1084a3a
编写于
9月 11, 2015
作者:
N
Nick Cameron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changes to tests
上级
d21bfff7
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
20 addition
and
34 deletion
+20
-34
src/librustc/lint/context.rs
src/librustc/lint/context.rs
+2
-2
src/librustc_driver/driver.rs
src/librustc_driver/driver.rs
+3
-4
src/test/auxiliary/lint_for_crate.rs
src/test/auxiliary/lint_for_crate.rs
+1
-1
src/test/auxiliary/lint_group_plugin_test.rs
src/test/auxiliary/lint_group_plugin_test.rs
+1
-1
src/test/auxiliary/lint_plugin_test.rs
src/test/auxiliary/lint_plugin_test.rs
+4
-4
src/test/compile-fail/autoderef-full-lval.rs
src/test/compile-fail/autoderef-full-lval.rs
+0
-1
src/test/compile-fail/borrow-tuple-fields.rs
src/test/compile-fail/borrow-tuple-fields.rs
+0
-1
src/test/compile-fail/cast-as-bool.rs
src/test/compile-fail/cast-as-bool.rs
+1
-1
src/test/compile-fail/dropck_arr_cycle_checked.rs
src/test/compile-fail/dropck_arr_cycle_checked.rs
+0
-1
src/test/compile-fail/dropck_tarena_cycle_checked.rs
src/test/compile-fail/dropck_tarena_cycle_checked.rs
+0
-2
src/test/compile-fail/dropck_tarena_unsound_drop.rs
src/test/compile-fail/dropck_tarena_unsound_drop.rs
+0
-2
src/test/compile-fail/dropck_vec_cycle_checked.rs
src/test/compile-fail/dropck_vec_cycle_checked.rs
+0
-1
src/test/compile-fail/for-loop-hygiene.rs
src/test/compile-fail/for-loop-hygiene.rs
+0
-2
src/test/compile-fail/issue-17283.rs
src/test/compile-fail/issue-17283.rs
+2
-0
src/test/compile-fail/issue-23729.rs
src/test/compile-fail/issue-23729.rs
+1
-1
src/test/compile-fail/lint-visible-private-types.rs
src/test/compile-fail/lint-visible-private-types.rs
+0
-1
src/test/compile-fail/loop-does-not-diverge.rs
src/test/compile-fail/loop-does-not-diverge.rs
+1
-1
src/test/compile-fail/variance-trait-bounds.rs
src/test/compile-fail/variance-trait-bounds.rs
+0
-1
src/test/compile-fail/variance-types.rs
src/test/compile-fail/variance-types.rs
+0
-1
src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
+0
-1
src/test/pretty/issue-4264.pp
src/test/pretty/issue-4264.pp
+3
-4
src/test/run-make/execution-engine/test.rs
src/test/run-make/execution-engine/test.rs
+1
-1
未找到文件。
src/librustc/lint/context.rs
浏览文件 @
c1084a3a
...
...
@@ -505,10 +505,10 @@ fn with_ast_lint_attrs<F>(&mut self,
impl
<
'a
>
EarlyContext
<
'a
>
{
fn
new
(
sess
:
&
'a
Session
,
krate
:
&
'a
ast
::
Crate
)
->
EarlyContext
<
'a
>
{
// We want to own the lint store, so move it out of the session.
// We want to own the lint store, so move it out of the session. Remember
// to put it back later...
let
lint_store
=
mem
::
replace
(
&
mut
*
sess
.lint_store
.borrow_mut
(),
LintStore
::
new
());
EarlyContext
{
sess
:
sess
,
krate
:
krate
,
...
...
src/librustc_driver/driver.rs
浏览文件 @
c1084a3a
...
...
@@ -129,6 +129,9 @@ pub fn compile_input(sess: Session,
&
ast_map
.krate
(),
&
id
[
..
]));
time
(
sess
.time_passes
(),
"early lint checks"
,
||
{
lint
::
check_ast_crate
(
&
sess
,
&
expanded_crate
)
});
phase_3_run_analysis_passes
(
sess
,
ast_map
,
...
...
@@ -597,10 +600,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
sess
.abort_if_errors
();
});
time
(
time_passes
,
"early lint checks"
,
||
{
lint
::
check_ast_crate
(
sess
,
&
krate
)
});
Some
(
krate
)
}
...
...
src/test/auxiliary/lint_for_crate.rs
浏览文件 @
c1084a3a
...
...
@@ -17,7 +17,7 @@
extern
crate
rustc_front
;
extern
crate
syntax
;
use
rustc
::
lint
::{
Context
,
LintPass
,
LintPassObject
,
LintArray
};
use
rustc
::
lint
::{
Context
,
Lint
Context
,
Lint
Pass
,
LintPassObject
,
LintArray
};
use
rustc
::
plugin
::
Registry
;
use
rustc_front
::
hir
;
use
syntax
::
attr
;
...
...
src/test/auxiliary/lint_group_plugin_test.rs
浏览文件 @
c1084a3a
...
...
@@ -20,7 +20,7 @@
extern
crate
rustc
;
use
rustc_front
::
hir
;
use
rustc
::
lint
::{
Context
,
LintPass
,
LintPassObject
,
LintArray
};
use
rustc
::
lint
::{
Context
,
Lint
Context
,
Lint
Pass
,
LintPassObject
,
LintArray
};
use
rustc
::
plugin
::
Registry
;
declare_lint!
(
TEST_LINT
,
Warn
,
"Warn about items named 'lintme'"
);
...
...
src/test/auxiliary/lint_plugin_test.rs
浏览文件 @
c1084a3a
...
...
@@ -13,15 +13,15 @@
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
extern
crate
rustc_front
;
extern
crate
syntax
;
// Load rustc as a plugin to get macros
#[macro_use]
extern
crate
rustc
;
use
rustc
::
lint
::{
Context
,
LintPass
,
LintPassObject
,
LintArray
};
use
rustc
::
lint
::{
EarlyContext
,
Lint
Context
,
LintPass
,
LintPassObject
,
LintArray
};
use
rustc
::
plugin
::
Registry
;
use
rustc_front
::
hir
;
use
syntax
::
ast
;
declare_lint!
(
TEST_LINT
,
Warn
,
"Warn about items named 'lintme'"
);
struct
Pass
;
...
...
@@ -31,7 +31,7 @@ fn get_lints(&self) -> LintArray {
lint_array!
(
TEST_LINT
)
}
fn
check_
item
(
&
mut
self
,
cx
:
&
Context
,
it
:
&
hir
::
Item
)
{
fn
check_
ast_item
(
&
mut
self
,
cx
:
&
EarlyContext
,
it
:
&
ast
::
Item
)
{
if
it
.ident.name
==
"lintme"
{
cx
.span_lint
(
TEST_LINT
,
it
.span
,
"item is named 'lintme'"
);
}
...
...
src/test/compile-fail/autoderef-full-lval.rs
浏览文件 @
c1084a3a
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
struct
clam
{
...
...
src/test/compile-fail/borrow-tuple-fields.rs
浏览文件 @
c1084a3a
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
struct
Foo
(
Box
<
isize
>
,
isize
);
...
...
src/test/compile-fail/cast-as-bool.rs
浏览文件 @
c1084a3a
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
fn
main
()
{
let
u
=
(
5
as
bool
)
;
let
u
=
5
as
bool
;
//~^ ERROR cannot cast as `bool`
//~^^ HELP compare with zero instead
}
src/test/compile-fail/dropck_arr_cycle_checked.rs
浏览文件 @
c1084a3a
...
...
@@ -19,7 +19,6 @@
use
id
::
Id
;
mod
s
{
#![allow(unstable)]
use
std
::
sync
::
atomic
::{
AtomicUsize
,
Ordering
};
static
S_COUNT
:
AtomicUsize
=
AtomicUsize
::
new
(
0
);
...
...
src/test/compile-fail/dropck_tarena_cycle_checked.rs
浏览文件 @
c1084a3a
...
...
@@ -16,7 +16,6 @@
// which is a reduction of this code to more directly show the reason
// for the error message we see here.)
#![allow(unstable)]
#![feature(const_fn)]
extern
crate
arena
;
...
...
@@ -26,7 +25,6 @@
use
id
::
Id
;
mod
s
{
#![allow(unstable)]
use
std
::
sync
::
atomic
::{
AtomicUsize
,
Ordering
};
static
S_COUNT
:
AtomicUsize
=
AtomicUsize
::
new
(
0
);
...
...
src/test/compile-fail/dropck_tarena_unsound_drop.rs
浏览文件 @
c1084a3a
...
...
@@ -19,8 +19,6 @@
// (Also compare against dropck_tarena_cycle_checked.rs, from which
// this was reduced to better understand its error message.)
#![allow(unstable)]
extern
crate
arena
;
use
arena
::
TypedArena
;
...
...
src/test/compile-fail/dropck_vec_cycle_checked.rs
浏览文件 @
c1084a3a
...
...
@@ -18,7 +18,6 @@
use
id
::
Id
;
mod
s
{
#![allow(unstable)]
use
std
::
sync
::
atomic
::{
AtomicUsize
,
Ordering
};
static
S_COUNT
:
AtomicUsize
=
AtomicUsize
::
new
(
0
);
...
...
src/test/compile-fail/for-loop-hygiene.rs
浏览文件 @
c1084a3a
...
...
@@ -11,8 +11,6 @@
// for-loops are expanded in the front end, and use an `iter` ident in their expansion. Check that
// `iter` is not accessible inside the for loop.
#![allow(unstable)]
fn
main
()
{
for
_
in
0
..
10
{
iter
.next
();
//~ error: unresolved name `iter`
...
...
src/test/compile-fail/issue-17283.rs
浏览文件 @
c1084a3a
...
...
@@ -11,6 +11,8 @@
// Test that the parser does not attempt to parse struct literals
// within assignments in if expressions.
#![allow(unused_parens)]
struct
Foo
{
foo
:
usize
}
...
...
src/test/compile-fail/issue-23729.rs
浏览文件 @
c1084a3a
...
...
@@ -26,7 +26,7 @@ fn next(&mut self) -> Option<u64> {
self
.pos
+=
1
;
Some
(
next_val
)
}
else
{
let
next_val
=
(
self
.mem
[
0
]
+
self
.mem
[
1
])
;
let
next_val
=
self
.mem
[
0
]
+
self
.mem
[
1
]
;
self
.mem
[
0
]
=
self
.mem
[
1
];
self
.mem
[
1
]
=
next_val
;
Some
(
next_val
)
...
...
src/test/compile-fail/lint-visible-private-types.rs
浏览文件 @
c1084a3a
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(visible_private_types)]
#![allow(dead_code)]
#![crate_type=
"lib"
]
...
...
src/test/compile-fail/loop-does-not-diverge.rs
浏览文件 @
c1084a3a
...
...
@@ -18,5 +18,5 @@ fn forever() -> ! {
}
fn
main
()
{
if
(
1
==
2
)
{
forever
();
}
if
1
==
2
{
forever
();
}
}
src/test/compile-fail/variance-trait-bounds.rs
浏览文件 @
c1084a3a
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bivariance)]
#![allow(dead_code)]
#![feature(rustc_attrs)]
...
...
src/test/compile-fail/variance-types.rs
浏览文件 @
c1084a3a
...
...
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bivariance)]
#![allow(dead_code)]
#![feature(rustc_attrs)]
...
...
src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
浏览文件 @
c1084a3a
...
...
@@ -29,7 +29,6 @@
use
id
::
Id
;
mod
s
{
#![allow(unstable)]
use
std
::
sync
::
atomic
::{
AtomicUsize
,
Ordering
};
static
S_COUNT
:
AtomicUsize
=
AtomicUsize
::
new
(
0
);
...
...
src/test/pretty/issue-4264.pp
浏览文件 @
c1084a3a
...
...
@@ -27,10 +27,9 @@ pub fn bar() {
let
_
:
[();
(
1
as
usize
)]
=
([(()
as
())]
as
[();
1
]);
let
_
=
(((
&
((([(
1
as
i32
),
(
2
as
i32
),
(
3
as
i32
)]
as
[
i32
;
3
]))
as
[
i32
;
3
])
as
&
[
i32
;
3
])
as
*
const
_
as
*
const
[
i32
;
3
])
as
*
const
[
i32
;
(
3
as
usize
)]
as
*
const
[
i32
;
3
]);
(((
&
([(
1
as
i32
),
(
2
as
i32
),
(
3
as
i32
)]
as
[
i32
;
3
])
as
&
[
i32
;
3
])
as
*
const
_
as
*
const
[
i32
;
3
])
as
*
const
[
i32
;
(
3
as
usize
)]
as
*
const
[
i32
;
3
]);
...
...
src/test/run-make/execution-engine/test.rs
浏览文件 @
c1084a3a
...
...
@@ -228,7 +228,7 @@ fn compile_program(input: &str, sysroot: PathBuf)
let
ast_map
=
driver
::
make_map
(
&
sess
,
&
mut
hir_forest
);
driver
::
phase_3_run_analysis_passes
(
sess
,
ast_map
,
&
krate
,
&
arenas
,
id
,
MakeGlobMap
::
No
,
|
tcx
,
analysis
|
{
sess
,
ast_map
,
&
arenas
,
id
,
MakeGlobMap
::
No
,
|
tcx
,
analysis
|
{
let
trans
=
driver
::
phase_4_translate_to_llvm
(
tcx
,
analysis
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录