Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c5dd9f53
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,发现更多精彩内容 >>
提交
c5dd9f53
编写于
12月 04, 2017
作者:
M
Michael Woerister
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
incr.comp.: Hash spans unconditionally for full accuracy.
上级
829a3497
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
146 addition
and
643 deletion
+146
-643
src/librustc/ich/hcx.rs
src/librustc/ich/hcx.rs
+3
-62
src/librustc/ich/impls_hir.rs
src/librustc/ich/impls_hir.rs
+6
-100
src/librustc/ich/impls_mir.rs
src/librustc/ich/impls_mir.rs
+4
-41
src/librustc/session/config.rs
src/librustc/session/config.rs
+2
-0
src/librustc_metadata/astencode.rs
src/librustc_metadata/astencode.rs
+1
-3
src/test/incremental/hashes/call_expressions.rs
src/test/incremental/hashes/call_expressions.rs
+1
-1
src/test/incremental/hashes/closure_expressions.rs
src/test/incremental/hashes/closure_expressions.rs
+1
-1
src/test/incremental/hashes/consts.rs
src/test/incremental/hashes/consts.rs
+1
-1
src/test/incremental/hashes/enum_constructors.rs
src/test/incremental/hashes/enum_constructors.rs
+1
-1
src/test/incremental/hashes/enum_defs.rs
src/test/incremental/hashes/enum_defs.rs
+1
-1
src/test/incremental/hashes/exported_vs_not.rs
src/test/incremental/hashes/exported_vs_not.rs
+1
-1
src/test/incremental/hashes/extern_mods.rs
src/test/incremental/hashes/extern_mods.rs
+1
-1
src/test/incremental/hashes/for_loops.rs
src/test/incremental/hashes/for_loops.rs
+1
-1
src/test/incremental/hashes/function_interfaces.rs
src/test/incremental/hashes/function_interfaces.rs
+1
-1
src/test/incremental/hashes/if_expressions.rs
src/test/incremental/hashes/if_expressions.rs
+1
-1
src/test/incremental/hashes/indexing_expressions.rs
src/test/incremental/hashes/indexing_expressions.rs
+1
-1
src/test/incremental/hashes/inherent_impls.rs
src/test/incremental/hashes/inherent_impls.rs
+1
-1
src/test/incremental/hashes/inline_asm.rs
src/test/incremental/hashes/inline_asm.rs
+1
-1
src/test/incremental/hashes/let_expressions.rs
src/test/incremental/hashes/let_expressions.rs
+1
-1
src/test/incremental/hashes/loop_expressions.rs
src/test/incremental/hashes/loop_expressions.rs
+1
-1
src/test/incremental/hashes/match_expressions.rs
src/test/incremental/hashes/match_expressions.rs
+1
-1
src/test/incremental/hashes/panic_exprs.rs
src/test/incremental/hashes/panic_exprs.rs
+72
-93
src/test/incremental/hashes/panic_exprs_no_overflow_checks.rs
...test/incremental/hashes/panic_exprs_no_overflow_checks.rs
+0
-225
src/test/incremental/hashes/statics.rs
src/test/incremental/hashes/statics.rs
+1
-1
src/test/incremental/hashes/struct_constructors.rs
src/test/incremental/hashes/struct_constructors.rs
+1
-1
src/test/incremental/hashes/struct_defs.rs
src/test/incremental/hashes/struct_defs.rs
+1
-1
src/test/incremental/hashes/trait_defs.rs
src/test/incremental/hashes/trait_defs.rs
+1
-1
src/test/incremental/hashes/trait_impls.rs
src/test/incremental/hashes/trait_impls.rs
+1
-1
src/test/incremental/hashes/type_defs.rs
src/test/incremental/hashes/type_defs.rs
+1
-1
src/test/incremental/hashes/unary_and_binary_exprs.rs
src/test/incremental/hashes/unary_and_binary_exprs.rs
+1
-1
src/test/incremental/hashes/while_let_loops.rs
src/test/incremental/hashes/while_let_loops.rs
+1
-1
src/test/incremental/hashes/while_loops.rs
src/test/incremental/hashes/while_loops.rs
+1
-1
src/test/incremental/ich_method_call_trait_scope.rs
src/test/incremental/ich_method_call_trait_scope.rs
+2
-13
src/test/incremental/ich_nested_items.rs
src/test/incremental/ich_nested_items.rs
+4
-9
src/test/incremental/ich_resolve_results.rs
src/test/incremental/ich_resolve_results.rs
+10
-30
src/test/incremental/source_loc_macros.rs
src/test/incremental/source_loc_macros.rs
+16
-14
src/test/incremental/spans_insignificant_w_o_debuginfo.rs
src/test/incremental/spans_insignificant_w_o_debuginfo.rs
+0
-26
src/test/incremental/spans_significant_w_panic.rs
src/test/incremental/spans_significant_w_panic.rs
+1
-2
未找到文件。
src/librustc/ich/hcx.rs
浏览文件 @
c5dd9f53
...
...
@@ -14,7 +14,6 @@
use
hir
::
map
::
definitions
::
Definitions
;
use
ich
::{
self
,
CachingCodemapView
};
use
middle
::
cstore
::
CrateStore
;
use
session
::
config
::
DebugInfoLevel
::
NoDebugInfo
;
use
ty
::{
TyCtxt
,
fast_reject
};
use
session
::
Session
;
...
...
@@ -24,7 +23,7 @@
use
std
::
collections
::
HashMap
;
use
syntax
::
ast
;
use
syntax
::
attr
;
use
syntax
::
codemap
::
CodeMap
;
use
syntax
::
ext
::
hygiene
::
SyntaxContext
;
use
syntax
::
symbol
::
Symbol
;
...
...
@@ -51,7 +50,6 @@ pub struct StableHashingContext<'gcx> {
body_resolver
:
BodyResolver
<
'gcx
>
,
hash_spans
:
bool
,
hash_bodies
:
bool
,
overflow_checks_enabled
:
bool
,
node_id_hashing_mode
:
NodeIdHashingMode
,
// Very often, we are hashing something that does not need the
...
...
@@ -89,8 +87,7 @@ pub fn new(sess: &'gcx Session,
definitions
:
&
'gcx
Definitions
,
cstore
:
&
'gcx
CrateStore
)
->
Self
{
let
hash_spans_initial
=
sess
.opts.debuginfo
!=
NoDebugInfo
;
let
check_overflow_initial
=
sess
.overflow_checks
();
let
hash_spans_initial
=
!
sess
.opts.debugging_opts.incremental_ignore_spans
;
debug_assert!
(
ich
::
IGNORED_ATTRIBUTES
.len
()
>
0
);
IGNORED_ATTR_NAMES
.with
(|
names
|
{
...
...
@@ -110,7 +107,6 @@ pub fn new(sess: &'gcx Session,
raw_codemap
:
sess
.codemap
(),
hash_spans
:
hash_spans_initial
,
hash_bodies
:
true
,
overflow_checks_enabled
:
check_overflow_initial
,
node_id_hashing_mode
:
NodeIdHashingMode
::
HashDefPath
,
}
}
...
...
@@ -120,11 +116,6 @@ pub fn sess(&self) -> &'gcx Session {
self
.sess
}
pub
fn
force_span_hashing
(
mut
self
)
->
Self
{
self
.hash_spans
=
true
;
self
}
#[inline]
pub
fn
while_hashing_hir_bodies
<
F
:
FnOnce
(
&
mut
Self
)
>
(
&
mut
self
,
hash_bodies
:
bool
,
...
...
@@ -174,11 +165,6 @@ pub fn node_to_hir_id(&self, node_id: ast::NodeId) -> hir::HirId {
self
.definitions
.node_to_hir_id
(
node_id
)
}
#[inline]
pub
fn
hash_spans
(
&
self
)
->
bool
{
self
.hash_spans
}
#[inline]
pub
fn
hash_bodies
(
&
self
)
->
bool
{
self
.hash_bodies
...
...
@@ -204,58 +190,13 @@ pub fn is_ignored_attr(&self, name: Symbol) -> bool {
})
}
pub
fn
hash_hir_item_like
<
F
:
FnOnce
(
&
mut
Self
)
>
(
&
mut
self
,
item_attrs
:
&
[
ast
::
Attribute
],
is_const
:
bool
,
f
:
F
)
{
let
prev_overflow_checks
=
self
.overflow_checks_enabled
;
if
is_const
||
attr
::
contains_name
(
item_attrs
,
"rustc_inherit_overflow_checks"
)
{
self
.overflow_checks_enabled
=
true
;
}
pub
fn
hash_hir_item_like
<
F
:
FnOnce
(
&
mut
Self
)
>
(
&
mut
self
,
f
:
F
)
{
let
prev_hash_node_ids
=
self
.node_id_hashing_mode
;
self
.node_id_hashing_mode
=
NodeIdHashingMode
::
Ignore
;
f
(
self
);
self
.node_id_hashing_mode
=
prev_hash_node_ids
;
self
.overflow_checks_enabled
=
prev_overflow_checks
;
}
#[inline]
pub
fn
binop_can_panic_at_runtime
(
&
self
,
binop
:
hir
::
BinOp_
)
->
bool
{
match
binop
{
hir
::
BiAdd
|
hir
::
BiSub
|
hir
::
BiShl
|
hir
::
BiShr
|
hir
::
BiMul
=>
self
.overflow_checks_enabled
,
hir
::
BiDiv
|
hir
::
BiRem
=>
true
,
hir
::
BiAnd
|
hir
::
BiOr
|
hir
::
BiBitXor
|
hir
::
BiBitAnd
|
hir
::
BiBitOr
|
hir
::
BiEq
|
hir
::
BiLt
|
hir
::
BiLe
|
hir
::
BiNe
|
hir
::
BiGe
|
hir
::
BiGt
=>
false
}
}
#[inline]
pub
fn
unop_can_panic_at_runtime
(
&
self
,
unop
:
hir
::
UnOp
)
->
bool
{
match
unop
{
hir
::
UnDeref
|
hir
::
UnNot
=>
false
,
hir
::
UnNeg
=>
self
.overflow_checks_enabled
,
}
}
}
...
...
src/librustc/ich/impls_hir.rs
浏览文件 @
c5dd9f53
...
...
@@ -529,63 +529,9 @@ fn hash_stable<W: StableHasherResult>(&self,
ref
attrs
}
=
*
self
;
let
spans_always_on
=
match
*
node
{
hir
::
ExprBox
(
..
)
|
hir
::
ExprArray
(
..
)
|
hir
::
ExprCall
(
..
)
|
hir
::
ExprLit
(
..
)
|
hir
::
ExprCast
(
..
)
|
hir
::
ExprType
(
..
)
|
hir
::
ExprIf
(
..
)
|
hir
::
ExprWhile
(
..
)
|
hir
::
ExprLoop
(
..
)
|
hir
::
ExprMatch
(
..
)
|
hir
::
ExprClosure
(
..
)
|
hir
::
ExprBlock
(
..
)
|
hir
::
ExprAssign
(
..
)
|
hir
::
ExprTupField
(
..
)
|
hir
::
ExprAddrOf
(
..
)
|
hir
::
ExprBreak
(
..
)
|
hir
::
ExprAgain
(
..
)
|
hir
::
ExprRet
(
..
)
|
hir
::
ExprYield
(
..
)
|
hir
::
ExprInlineAsm
(
..
)
|
hir
::
ExprRepeat
(
..
)
|
hir
::
ExprTup
(
..
)
|
hir
::
ExprMethodCall
(
..
)
|
hir
::
ExprPath
(
..
)
|
hir
::
ExprStruct
(
..
)
|
hir
::
ExprField
(
..
)
=>
{
// For these we only hash the span when debuginfo is on.
false
}
// For the following, spans might be significant because of
// panic messages indicating the source location.
hir
::
ExprBinary
(
op
,
..
)
=>
{
hcx
.binop_can_panic_at_runtime
(
op
.node
)
}
hir
::
ExprUnary
(
op
,
_
)
=>
{
hcx
.unop_can_panic_at_runtime
(
op
)
}
hir
::
ExprAssignOp
(
op
,
..
)
=>
{
hcx
.binop_can_panic_at_runtime
(
op
.node
)
}
hir
::
ExprIndex
(
..
)
=>
{
true
}
};
if
spans_always_on
{
hcx
.while_hashing_spans
(
true
,
|
hcx
|
{
span
.hash_stable
(
hcx
,
hasher
);
node
.hash_stable
(
hcx
,
hasher
);
attrs
.hash_stable
(
hcx
,
hasher
);
});
}
else
{
span
.hash_stable
(
hcx
,
hasher
);
node
.hash_stable
(
hcx
,
hasher
);
attrs
.hash_stable
(
hcx
,
hasher
);
}
span
.hash_stable
(
hcx
,
hasher
);
node
.hash_stable
(
hcx
,
hasher
);
attrs
.hash_stable
(
hcx
,
hasher
);
})
}
}
...
...
@@ -712,15 +658,7 @@ fn hash_stable<W: StableHasherResult>(&self,
span
}
=
*
self
;
let
is_const
=
match
*
node
{
hir
::
TraitItemKind
::
Const
(
..
)
|
hir
::
TraitItemKind
::
Type
(
..
)
=>
true
,
hir
::
TraitItemKind
::
Method
(
hir
::
MethodSig
{
constness
,
..
},
_
)
=>
{
constness
==
hir
::
Constness
::
Const
}
};
hcx
.hash_hir_item_like
(
attrs
,
is_const
,
|
hcx
|
{
hcx
.hash_hir_item_like
(|
hcx
|
{
name
.hash_stable
(
hcx
,
hasher
);
attrs
.hash_stable
(
hcx
,
hasher
);
generics
.hash_stable
(
hcx
,
hasher
);
...
...
@@ -757,15 +695,7 @@ fn hash_stable<W: StableHasherResult>(&self,
span
}
=
*
self
;
let
is_const
=
match
*
node
{
hir
::
ImplItemKind
::
Const
(
..
)
|
hir
::
ImplItemKind
::
Type
(
..
)
=>
true
,
hir
::
ImplItemKind
::
Method
(
hir
::
MethodSig
{
constness
,
..
},
_
)
=>
{
constness
==
hir
::
Constness
::
Const
}
};
hcx
.hash_hir_item_like
(
attrs
,
is_const
,
|
hcx
|
{
hcx
.hash_hir_item_like
(|
hcx
|
{
name
.hash_stable
(
hcx
,
hasher
);
vis
.hash_stable
(
hcx
,
hasher
);
defaultness
.hash_stable
(
hcx
,
hasher
);
...
...
@@ -884,30 +814,6 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Item {
fn
hash_stable
<
W
:
StableHasherResult
>
(
&
self
,
hcx
:
&
mut
StableHashingContext
<
'gcx
>
,
hasher
:
&
mut
StableHasher
<
W
>
)
{
let
is_const
=
match
self
.node
{
hir
::
ItemStatic
(
..
)
|
hir
::
ItemConst
(
..
)
=>
{
true
}
hir
::
ItemFn
(
_
,
_
,
constness
,
..
)
=>
{
constness
==
hir
::
Constness
::
Const
}
hir
::
ItemUse
(
..
)
|
hir
::
ItemExternCrate
(
..
)
|
hir
::
ItemForeignMod
(
..
)
|
hir
::
ItemGlobalAsm
(
..
)
|
hir
::
ItemMod
(
..
)
|
hir
::
ItemAutoImpl
(
..
)
|
hir
::
ItemTrait
(
..
)
|
hir
::
ItemImpl
(
..
)
|
hir
::
ItemTy
(
..
)
|
hir
::
ItemEnum
(
..
)
|
hir
::
ItemStruct
(
..
)
|
hir
::
ItemUnion
(
..
)
=>
{
false
}
};
let
hir
::
Item
{
name
,
ref
attrs
,
...
...
@@ -918,7 +824,7 @@ fn hash_stable<W: StableHasherResult>(&self,
span
}
=
*
self
;
hcx
.hash_hir_item_like
(
attrs
,
is_const
,
|
hcx
|
{
hcx
.hash_hir_item_like
(|
hcx
|
{
name
.hash_stable
(
hcx
,
hasher
);
attrs
.hash_stable
(
hcx
,
hasher
);
node
.hash_stable
(
hcx
,
hasher
);
...
...
src/librustc/ich/impls_mir.rs
浏览文件 @
c5dd9f53
...
...
@@ -55,48 +55,11 @@ fn hash_stable<W: StableHasherResult>(&self,
}
}
}
impl
<
'gcx
>
HashStable
<
StableHashingContext
<
'gcx
>>
for
mir
::
Terminator
<
'gcx
>
{
#[inline]
fn
hash_stable
<
W
:
StableHasherResult
>
(
&
self
,
hcx
:
&
mut
StableHashingContext
<
'gcx
>
,
hasher
:
&
mut
StableHasher
<
W
>
)
{
let
mir
::
Terminator
{
ref
kind
,
ref
source_info
,
}
=
*
self
;
let
hash_spans_unconditionally
=
match
*
kind
{
mir
::
TerminatorKind
::
Assert
{
..
}
=>
{
// Assert terminators generate a panic message that contains the
// source location, so we always have to feed its span into the
// ICH.
true
}
mir
::
TerminatorKind
::
Goto
{
..
}
|
mir
::
TerminatorKind
::
SwitchInt
{
..
}
|
mir
::
TerminatorKind
::
Resume
|
mir
::
TerminatorKind
::
Return
|
mir
::
TerminatorKind
::
GeneratorDrop
|
mir
::
TerminatorKind
::
Unreachable
|
mir
::
TerminatorKind
::
Drop
{
..
}
|
mir
::
TerminatorKind
::
DropAndReplace
{
..
}
|
mir
::
TerminatorKind
::
Yield
{
..
}
|
mir
::
TerminatorKind
::
Call
{
..
}
|
mir
::
TerminatorKind
::
FalseEdges
{
..
}
=>
false
,
};
if
hash_spans_unconditionally
{
hcx
.while_hashing_spans
(
true
,
|
hcx
|
{
source_info
.hash_stable
(
hcx
,
hasher
);
})
}
else
{
source_info
.hash_stable
(
hcx
,
hasher
);
}
kind
.hash_stable
(
hcx
,
hasher
);
}
}
impl_stable_hash_for!
(
struct
mir
::
Terminator
<
'tcx
>
{
kind
,
source_info
});
impl
<
'gcx
,
T
>
HashStable
<
StableHashingContext
<
'gcx
>>
for
mir
::
ClearCrossCrate
<
T
>
where
T
:
HashStable
<
StableHashingContext
<
'gcx
>>
...
...
src/librustc/session/config.rs
浏览文件 @
c5dd9f53
...
...
@@ -1084,6 +1084,8 @@ fn parse_optimization_fuel(slot: &mut Option<(String, u64)>, v: Option<&str>) ->
"dump hash information in textual format to stdout"
),
incremental_verify_ich
:
bool
=
(
false
,
parse_bool
,
[
UNTRACKED
],
"verify incr. comp. hashes of green query instances"
),
incremental_ignore_spans
:
bool
=
(
false
,
parse_bool
,
[
UNTRACKED
],
"ignore spans during ICH computation -- used for testing"
),
dump_dep_graph
:
bool
=
(
false
,
parse_bool
,
[
UNTRACKED
],
"dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv)"
),
query_dep_graph
:
bool
=
(
false
,
parse_bool
,
[
UNTRACKED
],
...
...
src/librustc_metadata/astencode.rs
浏览文件 @
c5dd9f53
...
...
@@ -47,9 +47,7 @@ pub fn encode_body(&mut self, body_id: hir::BodyId) -> Lazy<Ast<'tcx>> {
let
mut
hasher
=
StableHasher
::
new
();
hcx
.while_hashing_hir_bodies
(
true
,
|
hcx
|
{
hcx
.while_hashing_spans
(
false
,
|
hcx
|
{
body
.hash_stable
(
hcx
,
&
mut
hasher
);
});
body
.hash_stable
(
hcx
,
&
mut
hasher
);
});
hasher
.finish
()
...
...
src/test/incremental/hashes/call_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/closure_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/consts.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/enum_constructors.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/enum_defs.rs
浏览文件 @
c5dd9f53
...
...
@@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/exported_vs_not.rs
浏览文件 @
c5dd9f53
...
...
@@ -10,7 +10,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/extern_mods.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/for_loops.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/function_interfaces.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/if_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/indexing_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/inherent_impls.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/inline_asm.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/let_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/loop_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/match_expressions.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/panic_exprs.rs
浏览文件 @
c5dd9f53
...
...
@@ -28,155 +28,134 @@
// Indexing expression ---------------------------------------------------------
#[cfg(cfail1)]
pub
fn
indexing
(
slice
:
&
[
u8
])
->
u8
{
slice
[
100
]
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
indexing
(
slice
:
&
[
u8
])
->
u8
{
slice
[
100
]
#[cfg(cfail1)]
{
slice
[
100
]
}
#[cfg(not(cfail1))]
{
slice
[
100
]
}
}
// Arithmetic overflow plus ----------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_plus
(
val
:
i32
)
->
i32
{
val
+
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_plus
(
val
:
i32
)
->
i32
{
val
+
1
#[cfg(cfail1)]
{
val
+
1
}
#[cfg(not(cfail1))]
{
val
+
1
}
}
// Arithmetic overflow minus ----------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_minus
(
val
:
i32
)
->
i32
{
val
-
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_minus
(
val
:
i32
)
->
i32
{
val
-
1
#[cfg(cfail1)]
{
val
-
1
}
#[cfg(not(cfail1))]
{
val
-
1
}
}
// Arithmetic overflow mult ----------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_mult
(
val
:
i32
)
->
i32
{
val
*
2
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_mult
(
val
:
i32
)
->
i32
{
val
*
2
#[cfg(cfail1)]
{
val
*
2
}
#[cfg(not(cfail1))]
{
val
*
2
}
}
// Arithmetic overflow negation ------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_negation
(
val
:
i32
)
->
i32
{
-
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_negation
(
val
:
i32
)
->
i32
{
-
val
#[cfg(cfail1)]
{
-
val
}
#[cfg(not(cfail1))]
{
-
val
}
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
division_by_zero
(
val
:
i32
)
->
i32
{
2
/
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
division_by_zero
(
val
:
i32
)
->
i32
{
2
/
val
#[cfg(cfail1)]
{
2
/
val
}
#[cfg(not(cfail1))]
{
2
/
val
}
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
mod_by_zero
(
val
:
i32
)
->
i32
{
2
%
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
mod_by_zero
(
val
:
i32
)
->
i32
{
2
%
val
#[cfg(cfail1)]
{
2
%
val
}
#[cfg(not(cfail1))]
{
2
%
val
}
}
// shift left ------------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
shift_left
(
val
:
i32
,
shift
:
usize
)
->
i32
{
val
<<
shift
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
shift_left
(
val
:
i32
,
shift
:
usize
)
->
i32
{
val
<<
shift
#[cfg(cfail1)]
{
val
<<
shift
}
#[cfg(not(cfail1))]
{
val
<<
shift
}
}
// shift right ------------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
shift_right
(
val
:
i32
,
shift
:
usize
)
->
i32
{
val
>>
shift
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
shift_right
(
val
:
i32
,
shift
:
usize
)
->
i32
{
val
>>
shift
}
// THE FOLLOWING ITEMS SHOULD NOT BE INFLUENCED BY THEIR SOURCE LOCATION
// bitwise ---------------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
bitwise
(
val
:
i32
)
->
i32
{
!
val
&
0x101010101
|
0x45689
^
0x2372382
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
bitwise
(
val
:
i32
)
->
i32
{
!
val
&
0x101010101
|
0x45689
^
0x2372382
}
// logical ---------------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
logical
(
val1
:
bool
,
val2
:
bool
,
val3
:
bool
)
->
bool
{
val1
&&
val2
||
val3
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
logical
(
val1
:
bool
,
val2
:
bool
,
val3
:
bool
)
->
bool
{
val1
&&
val2
||
val3
#[cfg(cfail1)]
{
val
>>
shift
}
#[cfg(not(cfail1))]
{
val
>>
shift
}
}
src/test/incremental/hashes/panic_exprs_no_overflow_checks.rs
已删除
100644 → 0
浏览文件 @
829a3497
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// This test case tests the incremental compilation hash (ICH) implementation
// for exprs that can panic at runtime (e.g. because of bounds checking). For
// these expressions an error message containing their source location is
// generated, so their hash must always depend on their location in the source
// code, not just when debuginfo is enabled.
// As opposed to the panic_exprs.rs test case, this test case checks that things
// behave as expected when overflow checks are off:
//
// - Addition, subtraction, and multiplication do not change the ICH, unless
// the function containing them is marked with rustc_inherit_overflow_checks.
// - Division by zero and bounds checks always influence the ICH
// The general pattern followed here is: Change one thing between rev1 and rev2
// and make sure that the hash has changed, then change nothing between rev2 and
// rev3 and make sure that the hash has not changed.
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Z force-overflow-checks=off
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type=
"rlib"
]
// Indexing expression ---------------------------------------------------------
#[cfg(cfail1)]
pub
fn
indexing
(
slice
:
&
[
u8
])
->
u8
{
slice
[
100
]
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
indexing
(
slice
:
&
[
u8
])
->
u8
{
slice
[
100
]
}
// Arithmetic overflow plus ----------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_plus_inherit
(
val
:
i32
)
->
i32
{
val
+
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_plus_inherit
(
val
:
i32
)
->
i32
{
val
+
1
}
// Arithmetic overflow minus ----------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_minus_inherit
(
val
:
i32
)
->
i32
{
val
-
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_minus_inherit
(
val
:
i32
)
->
i32
{
val
-
1
}
// Arithmetic overflow mult ----------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_mult_inherit
(
val
:
i32
)
->
i32
{
val
*
2
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_mult_inherit
(
val
:
i32
)
->
i32
{
val
*
2
}
// Arithmetic overflow negation ------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_negation_inherit
(
val
:
i32
)
->
i32
{
-
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_inherit_overflow_checks]
pub
fn
arithmetic_overflow_negation_inherit
(
val
:
i32
)
->
i32
{
-
val
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
division_by_zero
(
val
:
i32
)
->
i32
{
2
/
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
division_by_zero
(
val
:
i32
)
->
i32
{
2
/
val
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
mod_by_zero
(
val
:
i32
)
->
i32
{
2
%
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"HirBody,MirValidated,MirOptimized"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
mod_by_zero
(
val
:
i32
)
->
i32
{
2
%
val
}
// THE FOLLOWING ITEMS SHOULD NOT BE INFLUENCED BY THEIR SOURCE LOCATION
// bitwise ---------------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
bitwise
(
val
:
i32
)
->
i32
{
!
val
&
0x101010101
|
0x45689
^
0x2372382
<<
1
>>
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
bitwise
(
val
:
i32
)
->
i32
{
!
val
&
0x101010101
|
0x45689
^
0x2372382
<<
1
>>
1
}
// logical ---------------------------------------------------------------------
#[cfg(cfail1)]
pub
fn
logical
(
val1
:
bool
,
val2
:
bool
,
val3
:
bool
)
->
bool
{
val1
&&
val2
||
val3
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
logical
(
val1
:
bool
,
val2
:
bool
,
val3
:
bool
)
->
bool
{
val1
&&
val2
||
val3
}
// Arithmetic overflow plus ----------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_plus
(
val
:
i32
)
->
i32
{
val
+
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_plus
(
val
:
i32
)
->
i32
{
val
+
1
}
// Arithmetic overflow minus ----------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_minus
(
val
:
i32
)
->
i32
{
val
-
1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_minus
(
val
:
i32
)
->
i32
{
val
-
1
}
// Arithmetic overflow mult ----------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_mult
(
val
:
i32
)
->
i32
{
val
*
2
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_mult
(
val
:
i32
)
->
i32
{
val
*
2
}
// Arithmetic overflow negation ------------------------------------------------
#[cfg(cfail1)]
pub
fn
arithmetic_overflow_negation
(
val
:
i32
)
->
i32
{
-
val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
pub
fn
arithmetic_overflow_negation
(
val
:
i32
)
->
i32
{
-
val
}
src/test/incremental/hashes/statics.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/struct_constructors.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/struct_defs.rs
浏览文件 @
c5dd9f53
...
...
@@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/trait_defs.rs
浏览文件 @
c5dd9f53
...
...
@@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/trait_impls.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
...
...
src/test/incremental/hashes/type_defs.rs
浏览文件 @
c5dd9f53
...
...
@@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/unary_and_binary_exprs.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Z
force-overflow-checks=off
// compile-flags: -Z query-dep-graph -Z
incremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/while_let_loops.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/while_loops.rs
浏览文件 @
c5dd9f53
...
...
@@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/ich_method_call_trait_scope.rs
浏览文件 @
c5dd9f53
...
...
@@ -30,21 +30,10 @@ fn method(&self) { }
impl
Trait2
for
()
{
}
#[cfg(rpass1)]
mod
mod3
{
#[cfg(rpass1)]
use
Trait1
;
fn
bar
()
{
()
.method
();
}
fn
baz
()
{
22
;
// no method call, traits in scope don't matter
}
}
#[cfg(rpass2)]
mod
mod3
{
#[cfg(rpass2)]
use
Trait2
;
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
...
...
src/test/incremental/ich_nested_items.rs
浏览文件 @
c5dd9f53
...
...
@@ -17,23 +17,18 @@
#![crate_type
=
"rlib"
]
#![feature(rustc_attrs)]
#[cfg(cfail1)]
pub
fn
foo
()
{
pub
fn
bar
()
{
}
pub
fn
baz
()
{
}
}
#[cfg(cfail2)]
#[rustc_clean(label=
"Hir"
,
cfg=
"cfail2"
)]
#[rustc_dirty(label=
"HirBody"
,
cfg=
"cfail2"
)]
pub
fn
foo
()
{
#[rustc_clean(label=
"Hir"
,
cfg=
"cfail2"
)]
#[rustc_clean(label=
"HirBody"
,
cfg=
"cfail2"
)]
#[cfg(cfail1)]
pub
fn
baz
()
{
}
// order is different...
#[rustc_clean(label=
"Hir"
,
cfg=
"cfail2"
)]
#[rustc_clean(label=
"HirBody"
,
cfg=
"cfail2"
)]
pub
fn
bar
()
{
}
// but that doesn't matter.
#[cfg(cfail2)]
pub
fn
baz
()
{
}
// order is different...
pub
fn
bap
()
{
}
// neither does adding a new item
}
src/test/incremental/ich_resolve_results.rs
浏览文件 @
c5dd9f53
...
...
@@ -25,49 +25,29 @@ mod mod2 {
pub
struct
Foo
(
pub
i64
);
}
#[cfg(rpass1)]
mod
mod3
{
use
test
;
#[cfg(rpass1)]
use
mod1
::
Foo
;
fn
in_expr
()
{
Foo
(
0
);
}
fn
in_type
()
{
test
::
<
Foo
>
();
}
}
#[cfg(rpass2)]
mod
mod3
{
use
mod1
::
Foo
;
// <-- Nothing changed, but reordered!
use
test
;
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_clean(label=
"HirBody"
,
cfg=
"rpass2"
)]
fn
in_expr
()
{
Foo
(
0
);
}
// In rpass2 we move the use declaration.
#[cfg(rpass2)]
use
mod1
::
Foo
;
// In rpass3 we let the declaration point to something else.
#[cfg(rpass3)]
use
mod2
::
Foo
;
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_clean(label=
"HirBody"
,
cfg=
"rpass2"
)]
fn
in_type
()
{
test
::
<
Foo
>
();
}
}
#[cfg(rpass3)]
mod
mod3
{
use
test
;
use
mod2
::
Foo
;
// <-- This changed!
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass3"
)]
#[rustc_dirty(label=
"HirBody"
,
cfg=
"rpass3"
)]
fn
in_expr
()
{
Foo
(
0
);
}
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_clean(label=
"HirBody"
,
cfg=
"rpass2"
)]
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass3"
)]
#[rustc_dirty(label=
"HirBody"
,
cfg=
"rpass3"
)]
fn
in_type
()
{
...
...
src/test/incremental/source_loc_macros.rs
浏览文件 @
c5dd9f53
...
...
@@ -35,28 +35,30 @@ fn file_same() {
let
_
=
file!
();
}
#[cfg(rpass1)]
fn
line_different
()
{
let
_
=
line!
();
}
#[cfg(rpass2)]
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_dirty(label=
"HirBody"
,
cfg=
"rpass2"
)]
fn
line_different
()
{
let
_
=
line!
();
}
#[cfg(rpass1)]
fn
col_different
()
{
let
_
=
column!
();
#[cfg(rpass1)]
{
let
_
=
line!
();
}
#[cfg(rpass2)]
{
let
_
=
line!
();
}
}
#[cfg(rpass2)]
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_dirty(label=
"HirBody"
,
cfg=
"rpass2"
)]
fn
col_different
()
{
let
_
=
column!
();
#[cfg(rpass1)]
{
let
_
=
column!
();
}
#[cfg(rpass2)]
{
let
_
=
column!
();
}
}
fn
main
()
{
...
...
src/test/incremental/spans_insignificant_w_o_debuginfo.rs
已删除
100644 → 0
浏览文件 @
829a3497
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// This test makes sure that just changing a definition's location in the
// source file does *not* change its incr. comp. hash, if debuginfo is disabled.
// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph
#![feature(rustc_attrs)]
#[cfg(rpass1)]
pub
fn
main
()
{}
#[cfg(rpass2)]
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_clean(label=
"HirBody"
,
cfg=
"rpass2"
)]
pub
fn
main
()
{}
src/test/incremental/spans_significant_w_panic.rs
浏览文件 @
c5dd9f53
...
...
@@ -23,8 +23,7 @@ pub fn main() {
}
#[cfg(rpass2)]
#[rustc_clean(label=
"Hir"
,
cfg=
"rpass2"
)]
#[rustc_dirty(label=
"HirBody"
,
cfg=
"rpass2"
)]
#[rustc_dirty(label=
"MirOptimized"
,
cfg=
"rpass2"
)]
pub
fn
main
()
{
let
_
=
0u8
+
1
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录