Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
11a999e6
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,发现更多精彩内容 >>
提交
11a999e6
编写于
4月 22, 2021
作者:
C
Camille GILLOT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Duplicate tests for incremental spans mode.
上级
2e37ed87
变更
30
展开全部
隐藏空白更改
内联
并排
Showing
30 changed file
with
2532 addition
and
1096 deletion
+2532
-1096
src/test/incremental/change_symbol_export_status.rs
src/test/incremental/change_symbol_export_status.rs
+10
-4
src/test/incremental/hashes/call_expressions.rs
src/test/incremental/hashes/call_expressions.rs
+46
-24
src/test/incremental/hashes/closure_expressions.rs
src/test/incremental/hashes/closure_expressions.rs
+36
-18
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
+91
-37
src/test/incremental/hashes/enum_defs.rs
src/test/incremental/hashes/enum_defs.rs
+157
-79
src/test/incremental/hashes/exported_vs_not.rs
src/test/incremental/hashes/exported_vs_not.rs
+20
-8
src/test/incremental/hashes/extern_mods.rs
src/test/incremental/hashes/extern_mods.rs
+64
-32
src/test/incremental/hashes/for_loops.rs
src/test/incremental/hashes/for_loops.rs
+58
-29
src/test/incremental/hashes/function_interfaces.rs
src/test/incremental/hashes/function_interfaces.rs
+145
-63
src/test/incremental/hashes/if_expressions.rs
src/test/incremental/hashes/if_expressions.rs
+45
-22
src/test/incremental/hashes/indexing_expressions.rs
src/test/incremental/hashes/indexing_expressions.rs
+40
-20
src/test/incremental/hashes/inherent_impls.rs
src/test/incremental/hashes/inherent_impls.rs
+378
-122
src/test/incremental/hashes/inline_asm.rs
src/test/incremental/hashes/inline_asm.rs
+34
-16
src/test/incremental/hashes/let_expressions.rs
src/test/incremental/hashes/let_expressions.rs
+77
-60
src/test/incremental/hashes/loop_expressions.rs
src/test/incremental/hashes/loop_expressions.rs
+46
-23
src/test/incremental/hashes/match_expressions.rs
src/test/incremental/hashes/match_expressions.rs
+82
-63
src/test/incremental/hashes/statics.rs
src/test/incremental/hashes/statics.rs
+58
-26
src/test/incremental/hashes/struct_constructors.rs
src/test/incremental/hashes/struct_constructors.rs
+53
-22
src/test/incremental/hashes/struct_defs.rs
src/test/incremental/hashes/struct_defs.rs
+90
-43
src/test/incremental/hashes/trait_defs.rs
src/test/incremental/hashes/trait_defs.rs
+503
-166
src/test/incremental/hashes/trait_impls.rs
src/test/incremental/hashes/trait_impls.rs
+193
-69
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
+126
-64
src/test/incremental/hashes/while_let_loops.rs
src/test/incremental/hashes/while_let_loops.rs
+49
-24
src/test/incremental/hashes/while_loops.rs
src/test/incremental/hashes/while_loops.rs
+50
-25
src/test/incremental/spans_significant_w_debuginfo.rs
src/test/incremental/spans_significant_w_debuginfo.rs
+9
-4
src/test/incremental/spans_significant_w_panic.rs
src/test/incremental/spans_significant_w_panic.rs
+16
-6
src/test/incremental/string_constant.rs
src/test/incremental/string_constant.rs
+11
-7
src/test/incremental/thinlto/cgu_keeps_identical_fn.rs
src/test/incremental/thinlto/cgu_keeps_identical_fn.rs
+43
-18
未找到文件。
src/test/incremental/change_symbol_export_status.rs
浏览文件 @
11a999e6
// revisions: rpass1 rpass2
// revisions: rpass1 rpass2
rpass3 rpass4
// compile-flags: -Zquery-dep-graph
// [rpass1]compile-flags: -Zincremental-ignore-spans
// [rpass2]compile-flags: -Zincremental-ignore-spans
// [rpass3]compile-flags: -Zincremental-relative-spans
// [rpass4]compile-flags: -Zincremental-relative-spans
#![feature(rustc_attrs)]
#![rustc_partition_
codegen
ed(module
=
"change_symbol_export_status-mod1"
,
cfg
=
"rpass2"
)]
#![rustc_partition_
reus
ed(module
=
"change_symbol_export_status-mod1"
,
cfg
=
"rpass2"
)]
#![rustc_partition_reused(module
=
"change_symbol_export_status-mod2"
,
cfg
=
"rpass2"
)]
#![rustc_partition_reused(module
=
"change_symbol_export_status-mod1"
,
cfg
=
"rpass4"
)]
#![rustc_partition_reused(module
=
"change_symbol_export_status-mod2"
,
cfg
=
"rpass4"
)]
// This test case makes sure that a change in symbol visibility is detected by
// our dependency tracking. We do this by changing a module's visibility to
...
...
@@ -13,13 +19,13 @@
// even from an executable. Plain Rust functions are only exported from Rust
// libraries, which our test infrastructure does not support.
#[cfg(
rpass1
)]
#[cfg(
any(rpass1,rpass3)
)]
pub
mod
mod1
{
#[no_mangle]
pub
fn
foo
()
{}
}
#[cfg(
rpass2
)]
#[cfg(
any(rpass2,rpass4)
)]
mod
mod1
{
#[no_mangle]
pub
fn
foo
()
{}
...
...
src/test/incremental/hashes/call_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
...
...
@@ -19,14 +25,16 @@ fn callee2(_x: u32, _y: i64) {}
// Change Callee (Function)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_callee_function
()
{
callee1
(
1
,
2
)
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_callee_function
()
{
callee2
(
1
,
2
)
}
...
...
@@ -34,14 +42,16 @@ pub fn change_callee_function() {
// Change Argument (Function)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_argument_function
()
{
callee1
(
1
,
2
)
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_argument_function
()
{
callee1
(
1
,
3
)
}
...
...
@@ -50,13 +60,15 @@ pub fn change_argument_function() {
// Change Callee Indirectly (Function)
mod
change_callee_indirectly_function
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
callee1
as
callee
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
callee2
as
callee
;
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_callee_indirectly_function
()
{
callee
(
1
,
2
)
}
...
...
@@ -70,15 +82,17 @@ fn method2(&self, _x: char, _y: bool) {}
}
// Change Callee (Method)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_callee_method
()
{
let
s
=
Struct
;
s
.method1
(
'x'
,
true
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_callee_method
()
{
let
s
=
Struct
;
s
.method2
(
'x'
,
true
);
...
...
@@ -87,15 +101,17 @@ pub fn change_callee_method() {
// Change Argument (Method)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_argument_method
()
{
let
s
=
Struct
;
s
.method1
(
'x'
,
true
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_argument_method
()
{
let
s
=
Struct
;
s
.method1
(
'y'
,
true
);
...
...
@@ -104,15 +120,17 @@ pub fn change_argument_method() {
// Change Callee (Method, UFCS)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_ufcs_callee_method
()
{
let
s
=
Struct
;
Struct
::
method1
(
&
s
,
'x'
,
true
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_ufcs_callee_method
()
{
let
s
=
Struct
;
Struct
::
method2
(
&
s
,
'x'
,
true
);
...
...
@@ -121,32 +139,36 @@ pub fn change_ufcs_callee_method() {
// Change Argument (Method, UFCS)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_argument_method_ufcs
()
{
let
s
=
Struct
;
Struct
::
method1
(
&
s
,
'x'
,
true
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_argument_method_ufcs
()
{
let
s
=
Struct
;
Struct
::
method1
(
&
s
,
'x'
,
false
);
Struct
::
method1
(
&
s
,
'x'
,
false
);
}
// Change To UFCS
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_to_ufcs
()
{
let
s
=
Struct
;
s
.method1
(
'x'
,
true
);
s
.method1
(
'x'
,
true
);
// ------
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
// One might think this would be expanded in the hir_owner_nodes/Mir, but it actually
// results in slightly different hir_owner/Mir.
pub
fn
change_to_ufcs
()
{
...
...
@@ -162,15 +184,15 @@ fn method1(&self, _x: char, _y: bool) {}
// Change UFCS Callee Indirectly
pub
mod
change_ufcs_callee_indirectly
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Struct
as
Struct
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Struct2
as
Struct
;
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_ufcs_callee_indirectly
()
{
let
s
=
Struct
;
Struct
::
method1
(
&
s
,
'q'
,
false
)
...
...
src/test/incremental/hashes/closure_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans -Zmir-opt-level=0
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph -Zmir-opt-level=0
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -15,14 +21,16 @@
// Change closure body
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_closure_body
()
{
let
_
=
||
1u32
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_closure_body
()
{
let
_
=
||
3u32
;
}
...
...
@@ -30,15 +38,17 @@ pub fn change_closure_body() {
// Add parameter
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_parameter
()
{
let
x
=
0u32
;
let
_
=
||
x
+
1
;
let
_
=
|
|
x
+
1
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_parameter
()
{
let
x
=
0u32
;
let
_
=
|
x
:
u32
|
x
+
1
;
...
...
@@ -47,14 +57,16 @@ pub fn add_parameter() {
// Change parameter pattern
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_parameter_pattern
()
{
let
_
=
|
x
:
(
u32
,)|
x
;
let
_
=
|
x
:
(
u32
,)|
x
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, typeck, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, typeck, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_parameter_pattern
()
{
let
_
=
|(
x
,):
(
u32
,)|
x
;
}
...
...
@@ -62,14 +74,16 @@ pub fn change_parameter_pattern() {
// Add `move` to closure
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_move
()
{
let
_
=
||
1
;
let
_
=
||
1
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_move
()
{
let
_
=
move
||
1
;
}
...
...
@@ -77,15 +91,17 @@ pub fn add_move() {
// Add type ascription to parameter
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_type_ascription_to_parameter
()
{
let
closure
=
|
x
|
x
+
1u32
;
let
closure
=
|
x
|
x
+
1u32
;
let
_
:
u32
=
closure
(
1
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner_nodes, typeck"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner_nodes, typeck"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
add_type_ascription_to_parameter
()
{
let
closure
=
|
x
:
u32
|
x
+
1u32
;
let
_
:
u32
=
closure
(
1
);
...
...
@@ -94,15 +110,17 @@ pub fn add_type_ascription_to_parameter() {
// Change parameter type
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_parameter_type
()
{
let
closure
=
|
x
:
u32
|
(
x
as
u64
)
+
1
;
let
_
=
closure
(
1
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_parameter_type
()
{
let
closure
=
|
x
:
u16
|
(
x
as
u64
)
+
1
;
let
_
=
closure
(
1
);
...
...
src/test/incremental/hashes/consts.rs
浏览文件 @
11a999e6
...
...
@@ -7,7 +7,7 @@
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
// compile-flags: -Z query-dep-graph
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/enum_constructors.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans -Zmir-opt-level=0
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph -Zmir-opt-level=0
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -24,7 +30,7 @@ pub enum Enum {
}
// Change field value (struct-like) -----------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_value_struct_like
()
->
Enum
{
Enum
::
Struct
{
x
:
0
,
...
...
@@ -33,9 +39,11 @@ pub fn change_field_value_struct_like() -> Enum {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_field_value_struct_like
()
->
Enum
{
Enum
::
Struct
{
x
:
0
,
...
...
@@ -47,7 +55,7 @@ pub fn change_field_value_struct_like() -> Enum {
// Change field order (struct-like) -----------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_order_struct_like
()
->
Enum
{
Enum
::
Struct
{
x
:
3
,
...
...
@@ -56,9 +64,11 @@ pub fn change_field_order_struct_like() -> Enum {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
// FIXME(michaelwoerister):Interesting. I would have thought that that changes the MIR. And it
// would if it were not all constants
pub
fn
change_field_order_struct_like
()
->
Enum
{
...
...
@@ -86,18 +96,20 @@ pub enum Enum2 {
}
// Change constructor path (struct-like) ------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_path_struct_like
()
{
let
_
=
Enum
::
Struct
{
let
_
=
Enum
::
Struct
{
x
:
0
,
y
:
1
,
z
:
2
,
};
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_path_struct_like
()
{
let
_
=
Enum2
::
Struct
{
x
:
0
,
...
...
@@ -109,18 +121,20 @@ pub fn change_constructor_path_struct_like() {
// Change variant (regular struct) ------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_variant_struct_like
()
{
let
_
=
Enum2
::
Struct
{
let
_
=
Enum2
::
Struct
{
x
:
0
,
y
:
1
,
z
:
2
,
};
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_variant_struct_like
()
{
let
_
=
Enum2
::
Struct2
{
x
:
0
,
...
...
@@ -132,9 +146,9 @@ pub fn change_constructor_variant_struct_like() {
// Change constructor path indirectly (struct-like) -------------------------
pub
mod
change_constructor_path_indirectly_struct_like
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Enum
as
TheEnum
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Enum2
as
TheEnum
;
#[rustc_clean(
...
...
@@ -143,6 +157,12 @@ pub mod change_constructor_path_indirectly_struct_like {
typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(
cfg=
"cfail5"
,
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,
\
typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
TheEnum
{
TheEnum
::
Struct
{
x
:
0
,
...
...
@@ -156,13 +176,15 @@ pub fn function() -> TheEnum {
// Change constructor variant indirectly (struct-like) ---------------------------
pub
mod
change_constructor_variant_indirectly_struct_like
{
use
super
::
Enum2
;
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Enum2
::
Struct
as
Variant
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Enum2
::
Struct2
as
Variant
;
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
Enum2
{
Variant
{
x
:
0
,
...
...
@@ -174,14 +196,16 @@ pub fn function() -> Enum2 {
// Change field value (tuple-like) -------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_value_tuple_like
()
->
Enum
{
Enum
::
Tuple
(
0
,
1
,
2
)
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_field_value_tuple_like
()
->
Enum
{
Enum
::
Tuple
(
0
,
1
,
3
)
}
...
...
@@ -189,17 +213,22 @@ pub fn change_field_value_tuple_like() -> Enum {
// Change constructor path (tuple-like) --------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_path_tuple_like
()
{
let
_
=
Enum
::
Tuple
(
0
,
1
,
2
);
let
_
=
Enum
::
Tuple
(
0
,
1
,
2
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(
cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_path_tuple_like
()
{
let
_
=
Enum2
::
Tuple
(
0
,
1
,
2
);
}
...
...
@@ -207,17 +236,22 @@ pub fn change_constructor_path_tuple_like() {
// Change constructor variant (tuple-like) --------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_variant_tuple_like
()
{
let
_
=
Enum2
::
Tuple
(
0
,
1
,
2
);
let
_
=
Enum2
::
Tuple
(
0
,
1
,
2
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(
cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_variant_tuple_like
()
{
let
_
=
Enum2
::
Tuple2
(
0
,
1
,
2
);
}
...
...
@@ -225,9 +259,9 @@ pub fn change_constructor_variant_tuple_like() {
// Change constructor path indirectly (tuple-like) ---------------------------
pub
mod
change_constructor_path_indirectly_tuple_like
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Enum
as
TheEnum
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Enum2
as
TheEnum
;
#[rustc_clean(
...
...
@@ -236,6 +270,12 @@ pub mod change_constructor_path_indirectly_tuple_like {
typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(
cfg=
"cfail5"
,
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,
\
typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
TheEnum
{
TheEnum
::
Tuple
(
0
,
1
,
2
)
}
...
...
@@ -246,13 +286,15 @@ pub fn function() -> TheEnum {
// Change constructor variant indirectly (tuple-like) ---------------------------
pub
mod
change_constructor_variant_indirectly_tuple_like
{
use
super
::
Enum2
;
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Enum2
::
Tuple
as
Variant
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Enum2
::
Tuple2
as
Variant
;
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
Enum2
{
Variant
(
0
,
1
,
2
)
}
...
...
@@ -272,14 +314,16 @@ pub enum Clike2 {
}
// Change constructor path (C-like) --------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_path_c_like
()
{
let
_
x
=
Clike
::
B
;
let
_
x
=
Clike
::
B
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_path_c_like
()
{
let
_
x
=
Clike2
::
B
;
}
...
...
@@ -287,14 +331,16 @@ pub fn change_constructor_path_c_like() {
// Change constructor variant (C-like) --------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_variant_c_like
()
{
let
_
x
=
Clike
::
A
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_variant_c_like
()
{
let
_
x
=
Clike
::
C
;
}
...
...
@@ -302,9 +348,9 @@ pub fn change_constructor_variant_c_like() {
// Change constructor path indirectly (C-like) ---------------------------
pub
mod
change_constructor_path_indirectly_c_like
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Clike
as
TheEnum
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Clike2
as
TheEnum
;
#[rustc_clean(
...
...
@@ -313,6 +359,12 @@ pub mod change_constructor_path_indirectly_c_like {
typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(
cfg=
"cfail5"
,
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,
\
typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
TheEnum
{
TheEnum
::
B
}
...
...
@@ -323,13 +375,15 @@ pub fn function() -> TheEnum {
// Change constructor variant indirectly (C-like) ---------------------------
pub
mod
change_constructor_variant_indirectly_c_like
{
use
super
::
Clike
;
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
Clike
::
A
as
Variant
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
Clike
::
B
as
Variant
;
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
Clike
{
Variant
}
...
...
src/test/incremental/hashes/enum_defs.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/exported_vs_not.rs
浏览文件 @
11a999e6
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -10,14 +16,16 @@
// the hash of the hir_owner_nodes node should change, but not the hash of
// either the hir_owner or the Metadata node.
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
body_not_exported_to_metadata
()
->
u32
{
1
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
body_not_exported_to_metadata
()
->
u32
{
2
}
...
...
@@ -28,15 +36,17 @@ pub fn body_not_exported_to_metadata() -> u32 {
// marked as #[inline]. Only the hash of the hir_owner depnode should be
// unaffected by a change to the body.
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[inline]
pub
fn
body_exported_to_metadata_because_of_inline
()
->
u32
{
1
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[inline]
pub
fn
body_exported_to_metadata_because_of_inline
()
->
u32
{
2
...
...
@@ -48,15 +58,17 @@ pub fn body_exported_to_metadata_because_of_inline() -> u32 {
// generic. Only the hash of the hir_owner depnode should be
// unaffected by a change to the body.
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[inline]
pub
fn
body_exported_to_metadata_because_of_generic
()
->
u32
{
1
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[inline]
pub
fn
body_exported_to_metadata_because_of_generic
()
->
u32
{
2
...
...
src/test/incremental/hashes/extern_mods.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -15,146 +21,168 @@
#![crate_type
=
"rlib"
]
// Change function name --------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
change_function_name1
(
c
:
i64
)
->
i32
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
change_function_name2
(
c
:
i64
)
->
i32
;
}
// Change parameter name -------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
change_parameter_name
(
c
:
i64
)
->
i32
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
change_parameter_name
(
d
:
i64
)
->
i32
;
}
// Change parameter type -------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
change_parameter_type
(
c
:
i64
)
->
i32
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
change_parameter_type
(
c
:
i32
)
->
i32
;
}
// Change return type ----------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
change_return_type
(
c
:
i32
)
->
i32
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
change_return_type
(
c
:
i32
)
->
i8
;
pub
fn
change_return_type
(
c
:
i32
)
->
i8
;
}
// Add parameter ---------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
add_parameter
(
c
:
i32
)
->
i32
;
pub
fn
add_parameter
(
c
:
i32
)
->
i32
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
add_parameter
(
c
:
i32
,
d
:
i32
)
->
i32
;
}
// Add return type -------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
add_return_type
(
c
:
i32
);
pub
fn
add_return_type
(
c
:
i32
)
;
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
add_return_type
(
c
:
i32
)
->
i32
;
}
// Make function variadic ------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
make_function_variadic
(
c
:
i32
);
pub
fn
make_function_variadic
(
c
:
i32
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
make_function_variadic
(
c
:
i32
,
...
);
}
// Change calling convention ---------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
change_calling_convention
(
c
:
i32
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"rust-call"
{
pub
fn
change_calling_convention
(
c
:
i32
);
}
// Make function public --------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
fn
make_function_public
(
c
:
i32
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
make_function_public
(
c
:
i32
);
}
// Add function ----------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
extern
"C"
{
pub
fn
add_function1
(
c
:
i32
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
add_function1
(
c
:
i32
);
pub
fn
add_function2
();
}
// Change link-name ------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[link(name
=
"foo"
)]
extern
"C"
{
pub
fn
change_link_name
(
c
:
i32
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
#[link(name
=
"bar"
)]
extern
"C"
{
pub
fn
change_link_name
(
c
:
i32
);
...
...
@@ -165,13 +193,15 @@
// Indirectly change parameter type --------------------------------------------
mod
indirectly_change_parameter_type
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
c_i32
as
c_int
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
c_i64
as
c_int
;
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
indirectly_change_parameter_type
(
c
:
c_int
);
}
...
...
@@ -179,13 +209,15 @@ mod indirectly_change_parameter_type {
// Indirectly change return type --------------------------------------------
mod
indirectly_change_return_type
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
c_i32
as
c_int
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
c_i64
as
c_int
;
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
extern
"C"
{
pub
fn
indirectly_change_return_type
()
->
c_int
;
}
...
...
src/test/incremental/hashes/for_loops.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -15,7 +21,7 @@
// Change loop body ------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_loop_body
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
...
...
@@ -24,9 +30,11 @@ pub fn change_loop_body() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_loop_body
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
...
...
@@ -38,7 +46,7 @@ pub fn change_loop_body() {
// Change iteration variable name ----------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_iteration_variable_name
()
{
let
mut
_
x
=
0
;
for
_
i
in
0
..
1
{
...
...
@@ -47,9 +55,11 @@ pub fn change_iteration_variable_name() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_iteration_variable_name
()
{
let
mut
_
x
=
0
;
for
_
a
in
0
..
1
{
...
...
@@ -61,18 +71,20 @@ pub fn change_iteration_variable_name() {
// Change iteration variable pattern -------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_iteration_variable_pattern
()
{
let
mut
_
x
=
0
;
for
_
i
in
&
[
0
,
1
,
2
]
{
for
_
i
in
&
[
0
,
1
,
2
]
{
_
x
=
1
;
break
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir, typeck, promoted_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_iteration_variable_pattern
()
{
let
mut
_
x
=
0
;
for
&
_
i
in
&
[
0
,
1
,
2
]
{
...
...
@@ -84,7 +96,7 @@ pub fn change_iteration_variable_pattern() {
// Change iterable -------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_iterable
()
{
let
mut
_
x
=
0
;
for
_
in
&
[
0
,
1
,
2
]
{
...
...
@@ -93,9 +105,11 @@ pub fn change_iterable() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, promoted_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, promoted_mir, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_iterable
()
{
let
mut
_
x
=
0
;
for
_
in
&
[
0
,
1
,
3
]
{
...
...
@@ -107,17 +121,20 @@ pub fn change_iterable() {
// Add break -------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_break
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
_
x
=
1
;
// ---
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_break
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
...
...
@@ -129,18 +146,20 @@ pub fn add_break() {
// Add loop label --------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_loop_label
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
for
_
in
0
..
1
{
_
x
=
1
;
break
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_loop_label
()
{
let
mut
_
x
=
0
;
'label
:
for
_
in
0
..
1
{
...
...
@@ -152,18 +171,20 @@ pub fn add_loop_label() {
// Add loop label to break -----------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_loop_label_to_break
()
{
let
mut
_
x
=
0
;
'label
:
for
_
in
0
..
1
{
_
x
=
1
;
break
;
break
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_loop_label_to_break
()
{
let
mut
_
x
=
0
;
'label
:
for
_
in
0
..
1
{
...
...
@@ -175,7 +196,7 @@ pub fn add_loop_label_to_break() {
// Change break label ----------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_break_label
()
{
let
mut
_
x
=
0
;
'outer
:
for
_
in
0
..
1
{
...
...
@@ -186,9 +207,11 @@ pub fn change_break_label() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_break_label
()
{
let
mut
_
x
=
0
;
'outer
:
for
_
in
0
..
1
{
...
...
@@ -202,18 +225,20 @@ pub fn change_break_label() {
// Add loop label to continue --------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_loop_label_to_continue
()
{
let
mut
_
x
=
0
;
'label
:
for
_
in
0
..
1
{
_
x
=
1
;
continue
;
continue
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_loop_label_to_continue
()
{
let
mut
_
x
=
0
;
'label
:
for
_
in
0
..
1
{
...
...
@@ -225,7 +250,7 @@ pub fn add_loop_label_to_continue() {
// Change continue label ----------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_continue_label
()
{
let
mut
_
x
=
0
;
'outer
:
for
_
in
0
..
1
{
...
...
@@ -236,9 +261,11 @@ pub fn change_continue_label() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_continue_label
()
{
let
mut
_
x
=
0
;
'outer
:
for
_
in
0
..
1
{
...
...
@@ -252,7 +279,7 @@ pub fn change_continue_label() {
// Change continue to break ----------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_continue_to_break
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
...
...
@@ -261,13 +288,15 @@ pub fn change_continue_to_break() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_continue_to_break
()
{
let
mut
_
x
=
0
;
for
_
in
0
..
1
{
_
x
=
1
;
break
;
break
;
}
}
src/test/incremental/hashes/function_interfaces.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(linkage)]
...
...
@@ -16,248 +22,310 @@
// Add Parameter ---------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_parameter
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
add_parameter
(
p
:
i32
)
{}
// Add Return Type -------------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
add_return_type
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_return_type
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
add_return_type
()
->
()
{}
// Change Parameter Type -------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
type_of_parameter
(
p
:
i32
)
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
type_of_parameter
(
p
:
i64
)
{}
// Change Parameter Type Reference ---------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
type_of_parameter_ref
(
p
:
&
i32
)
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
type_of_parameter_ref
(
p
:
&
mut
i32
)
{}
// Change Parameter Order ------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
order_of_parameters
(
p1
:
i32
,
p2
:
i64
)
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
order_of_parameters
(
p2
:
i64
,
p1
:
i32
)
{}
// Unsafe ----------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
make_unsafe
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
unsafe
fn
make_unsafe
()
{}
// Extern ----------------------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
make_extern
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
make_extern
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
extern
"C"
fn
make_extern
()
{}
// Type Parameter --------------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
type_parameter
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
type_parameter
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
type_parameter
<
T
>
()
{}
// Lifetime Parameter ----------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
lifetime_parameter
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
lifetime_parameter
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, generics_of,fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, generics_of,fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
lifetime_parameter
<
'a
>
()
{}
// Trait Bound -----------------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
trait_bound
<
T
>
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
trait_bound
<
T
>
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
pub
fn
trait_bound
<
T
:
Eq
>
()
{}
// Builtin Bound ---------------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
builtin_bound
<
T
>
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
builtin_bound
<
T
>
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
builtin_bound
<
T
:
Send
>
()
{}
// Lifetime Bound --------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
lifetime_bound
<
'a
,
T
>
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig,optimized_mir"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
lifetime_bound
<
'a
,
T
:
'a
>
()
{}
// Second Trait Bound ----------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
second_trait_bound
<
T
:
Eq
>
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
second_trait_bound
<
T
:
Eq
>
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
pub
fn
second_trait_bound
<
T
:
Eq
+
Clone
>
()
{}
// Second Builtin Bound --------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
second_builtin_bound
<
T
:
Send
>
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
second_builtin_bound
<
T
:
Send
>
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
second_builtin_bound
<
T
:
Send
+
Sized
>
()
{}
// Second Lifetime Bound -------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
second_lifetime_bound
<
'a
,
'b
,
T
:
'a
>
()
{}
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
second_lifetime_bound
<
'a
,
'b
,
T
:
'a
>
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(
cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, generics_of, type_of, predicates_of,fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
second_lifetime_bound
<
'a
,
'b
,
T
:
'a
+
'b
>
()
{}
// Inline ----------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
inline
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
#[inline]
pub
fn
inline
()
{}
// Inline Never ----------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[inline(always)]
pub
fn
inline_never
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
#[inline(never)]
pub
fn
inline_never
()
{}
// No Mangle -------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
no_mangle
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
#[no_mangle]
pub
fn
no_mangle
()
{}
// Linkage ---------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
linkage
()
{}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
#[linkage
=
"weak_odr"
]
pub
fn
linkage
()
{}
// Return Impl Trait -----------------------------------------------------------
#[cfg(
cfail1
)]
pub
fn
return_impl_trait
()
->
i32
{
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
return_impl_trait
()
->
i32
{
0
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, typeck, fn_sig, optimized_mir"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
return_impl_trait
()
->
impl
Clone
{
0
}
// Change Return Impl Trait ----------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_return_impl_trait
()
->
impl
Clone
{
0u32
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg
=
"cfail2"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
pub
fn
change_return_impl_trait
()
->
impl
Copy
{
#[rustc_clean(cfg
=
"cfail5"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
change_return_impl_trait
()
->
impl
Copy
{
0u32
}
...
...
@@ -267,9 +335,9 @@ pub fn change_return_impl_trait() -> impl Copy {
pub
struct
ReferencedType2
;
pub
mod
change_return_type_indirectly
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
ReferencedType1
as
ReturnType
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
ReferencedType2
as
ReturnType
;
#[rustc_clean(
...
...
@@ -277,6 +345,11 @@ pub mod change_return_type_indirectly {
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
indirect_return_type
()
->
ReturnType
{
ReturnType
{}
}
...
...
@@ -285,9 +358,9 @@ pub fn indirect_return_type() -> ReturnType {
// Change Parameter Type Indirectly --------------------------------------------
pub
mod
change_parameter_type_indirectly
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
ReferencedType1
as
ParameterType
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
ReferencedType2
as
ParameterType
;
#[rustc_clean(
...
...
@@ -295,6 +368,11 @@ pub mod change_parameter_type_indirectly {
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(
cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, optimized_mir, typeck, fn_sig"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
indirect_parameter_type
(
p
:
ParameterType
)
{}
}
...
...
@@ -304,26 +382,30 @@ pub trait ReferencedTrait1 {}
pub
trait
ReferencedTrait2
{}
pub
mod
change_trait_bound_indirectly
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
ReferencedTrait1
as
Trait
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
ReferencedTrait2
as
Trait
;
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
indirect_trait_bound
<
T
:
Trait
>
(
p
:
T
)
{}
}
// Change Trait Bound Indirectly In Where Clause -------------------------------
pub
mod
change_trait_bound_indirectly_in_where_clause
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
ReferencedTrait1
as
Trait
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
ReferencedTrait2
as
Trait
;
#[rustc_clean(cfg
=
"cfail2"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail3"
)]
#[rustc_clean(cfg
=
"cfail5"
,
except
=
"hir_owner, hir_owner_nodes, predicates_of"
)]
#[rustc_clean(cfg
=
"cfail6"
)]
pub
fn
indirect_trait_bound_where
<
T
>
(
p
:
T
)
where
T
:
Trait
,
...
...
src/test/incremental/hashes/if_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,27 +6,34 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type=
"rlib"
]
// Change condition (if)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_condition
(
x
:
bool
)
->
u32
{
if
x
{
if
x
{
return
1
}
return
0
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_condition
(
x
:
bool
)
->
u32
{
if
!
x
{
return
1
...
...
@@ -36,7 +43,7 @@ pub fn change_condition(x: bool) -> u32 {
}
// Change then branch (if)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_then_branch
(
x
:
bool
)
->
u32
{
if
x
{
return
1
...
...
@@ -45,9 +52,11 @@ pub fn change_then_branch(x: bool) -> u32 {
return
0
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_then_branch
(
x
:
bool
)
->
u32
{
if
x
{
return
2
...
...
@@ -59,7 +68,7 @@ pub fn change_then_branch(x: bool) -> u32 {
// Change else branch (if)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_else_branch
(
x
:
bool
)
->
u32
{
if
x
{
1
...
...
@@ -68,9 +77,11 @@ pub fn change_else_branch(x: bool) -> u32 {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_else_branch
(
x
:
bool
)
->
u32
{
if
x
{
1
...
...
@@ -82,20 +93,23 @@ pub fn change_else_branch(x: bool) -> u32 {
// Add else branch (if)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_else_branch
(
x
:
bool
)
->
u32
{
let
mut
ret
=
1
;
if
x
{
ret
=
2
;
/*----*/
}
ret
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_else_branch
(
x
:
bool
)
->
u32
{
let
mut
ret
=
1
;
...
...
@@ -110,7 +124,7 @@ pub fn add_else_branch(x: bool) -> u32 {
// Change condition (if let)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_condition_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
if
let
Some
(
_
x
)
=
x
{
return
1
...
...
@@ -119,11 +133,13 @@ pub fn change_condition_if_let(x: Option<u32>) -> u32 {
0
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_condition_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
if
let
Some
(
_
)
=
x
{
if
let
Some
(
_
)
=
x
{
return
1
}
...
...
@@ -133,18 +149,20 @@ pub fn change_condition_if_let(x: Option<u32>) -> u32 {
// Change then branch (if let)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_then_branch_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
if
let
Some
(
x
)
=
x
{
return
x
return
x
//-
}
0
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_then_branch_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
if
let
Some
(
x
)
=
x
{
return
x
+
1
...
...
@@ -156,7 +174,7 @@ pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
// Change else branch (if let)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_else_branch_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
if
let
Some
(
x
)
=
x
{
x
...
...
@@ -165,9 +183,11 @@ pub fn change_else_branch_if_let(x: Option<u32>) -> u32 {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_else_branch_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
if
let
Some
(
x
)
=
x
{
x
...
...
@@ -179,20 +199,23 @@ pub fn change_else_branch_if_let(x: Option<u32>) -> u32 {
// Add else branch (if let)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_else_branch_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
let
mut
ret
=
1
;
if
let
Some
(
x
)
=
x
{
ret
=
x
;
/*----*/
}
ret
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_else_branch_if_let
(
x
:
Option
<
u32
>
)
->
u32
{
let
mut
ret
=
1
;
...
...
src/test/incremental/hashes/indexing_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,22 +6,30 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type=
"rlib"
]
// Change simple index
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
change_simple_index
(
slice
:
&
[
u32
])
->
u32
{
slice
[
3
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
change_simple_index
(
slice
:
&
[
u32
])
->
u32
{
slice
[
4
]
}
...
...
@@ -29,14 +37,16 @@ fn change_simple_index(slice: &[u32]) -> u32 {
// Change lower bound
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
change_lower_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
5
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
change_lower_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
2
..
5
]
}
...
...
@@ -44,14 +54,16 @@ fn change_lower_bound(slice: &[u32]) -> &[u32] {
// Change upper bound
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
change_upper_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
5
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
change_upper_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
7
]
}
...
...
@@ -59,14 +71,16 @@ fn change_upper_bound(slice: &[u32]) -> &[u32] {
// Add lower bound
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
add_lower_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
..
4
]
&
slice
[
..
4
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
add_lower_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
4
]
}
...
...
@@ -74,14 +88,16 @@ fn add_lower_bound(slice: &[u32]) -> &[u32] {
// Add upper bound
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
add_upper_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
]
&
slice
[
3
..
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
add_upper_bound
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
7
]
}
...
...
@@ -89,29 +105,33 @@ fn add_upper_bound(slice: &[u32]) -> &[u32] {
// Change mutability
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
change_mutability
(
slice
:
&
mut
[
u32
])
->
u32
{
(
&
mut
slice
[
3
..
5
])[
0
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
change_mutability
(
slice
:
&
mut
[
u32
])
->
u32
{
(
&
slice
[
3
..
5
])[
0
]
(
&
slice
[
3
..
5
])[
0
]
}
// Exclusive to inclusive range
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
fn
exclusive_to_inclusive_range
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..
7
]
&
slice
[
3
..
7
]
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(except=
"hir_owner_nodes,typeck"
,
cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
fn
exclusive_to_inclusive_range
(
slice
:
&
[
u32
])
->
&
[
u32
]
{
&
slice
[
3
..=
7
]
}
src/test/incremental/hashes/inherent_impls.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/inline_asm.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -17,7 +23,7 @@
// Change template
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_template
(
a
:
i32
)
->
i32
{
let
c
:
i32
;
...
...
@@ -32,9 +38,11 @@ pub fn change_template(a: i32) -> i32 {
c
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_template
(
a
:
i32
)
->
i32
{
let
c
:
i32
;
...
...
@@ -52,7 +60,7 @@ pub fn change_template(a: i32) -> i32 {
// Change output
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_output
(
a
:
i32
)
->
i32
{
let
mut
_
out1
:
i32
=
0
;
...
...
@@ -68,9 +76,11 @@ pub fn change_output(a: i32) -> i32 {
_
out1
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_output
(
a
:
i32
)
->
i32
{
let
mut
_
out1
:
i32
=
0
;
...
...
@@ -89,7 +99,7 @@ pub fn change_output(a: i32) -> i32 {
// Change input
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_input
(
_
a
:
i32
,
_
b
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -104,9 +114,11 @@ pub fn change_input(_a: i32, _b: i32) -> i32 {
_
out
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_input
(
_
a
:
i32
,
_
b
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -124,7 +136,7 @@ pub fn change_input(_a: i32, _b: i32) -> i32 {
// Change input constraint
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_input_constraint
(
_
a
:
i32
,
_
b
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -139,9 +151,11 @@ pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
_
out
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_input_constraint
(
_
a
:
i32
,
_
b
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -159,7 +173,7 @@ pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
// Change clobber
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_clobber
(
_
a
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -167,16 +181,18 @@ pub fn change_clobber(_a: i32) -> i32 {
llvm_asm!
(
"add 1, $0"
:
"=r"
(
_
out
)
:
"0"
(
_
a
)
:
:
/*--*/
:
);
}
_
out
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_clobber
(
_
a
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -194,7 +210,7 @@ pub fn change_clobber(_a: i32) -> i32 {
// Change options
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_options
(
_
a
:
i32
)
->
i32
{
let
_
out
;
...
...
@@ -203,15 +219,17 @@ pub fn change_options(_a: i32) -> i32 {
:
"=r"
(
_
out
)
:
"0"
(
_
a
)
:
:
:
/*-------*/
);
}
_
out
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
pub
fn
change_options
(
_
a
:
i32
)
->
i32
{
let
_
out
;
...
...
src/test/incremental/hashes/let_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,24 +6,30 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type=
"rlib"
]
// Change Name -----------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_name
()
{
let
_
x
=
2u64
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_name
()
{
let
_
y
=
2u64
;
}
...
...
@@ -31,15 +37,16 @@ pub fn change_name() {
// Add Type --------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_type
()
{
let
_
x
=
2u32
;
let
_
x
=
2u32
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_type
()
{
let
_
x
:
u32
=
2u32
;
}
...
...
@@ -47,31 +54,33 @@ pub fn add_type() {
// Change Type -----------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_type
()
{
let
_
x
:
u64
=
2
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_type
()
{
let
_
x
:
u8
=
2
;
let
_
x
:
u8
=
2
;
}
// Change Mutability of Reference Type -----------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_mutability_of_reference_type
()
{
let
_
x
:
&
u64
;
let
_
x
:
&
u64
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_mutability_of_reference_type
()
{
let
_
x
:
&
mut
u64
;
}
...
...
@@ -79,31 +88,33 @@ pub fn change_mutability_of_reference_type() {
// Change Mutability of Slot ---------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_mutability_of_slot
()
{
let
mut
_
x
:
u64
=
0
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_mutability_of_slot
()
{
let
_
x
:
u64
=
0
;
let
_
x
:
u64
=
0
;
}
// Change Simple Binding to Pattern --------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_simple_binding_to_pattern
()
{
let
_
x
=
(
0u8
,
'x'
);
let
_
x
=
(
0u8
,
'x'
);
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_simple_binding_to_pattern
()
{
let
(
_
a
,
_
b
)
=
(
0u8
,
'x'
);
}
...
...
@@ -111,15 +122,16 @@ pub fn change_simple_binding_to_pattern() {
// Change Name in Pattern ------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_name_in_pattern
()
{
let
(
_
a
,
_
b
)
=
(
1u8
,
'y'
);
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_name_in_pattern
()
{
let
(
_
a
,
_
c
)
=
(
1u8
,
'y'
);
}
...
...
@@ -127,15 +139,16 @@ pub fn change_name_in_pattern() {
// Add `ref` in Pattern --------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_ref_in_pattern
()
{
let
(
_
a
,
_
b
)
=
(
1u8
,
'y'
);
let
(
_
a
,
_
b
)
=
(
1u8
,
'y'
);
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_ref_in_pattern
()
{
let
(
ref
_
a
,
_
b
)
=
(
1u8
,
'y'
);
}
...
...
@@ -143,15 +156,16 @@ pub fn add_ref_in_pattern() {
// Add `&` in Pattern ----------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_amp_in_pattern
()
{
let
(
_
a
,
_
b
)
=
(
&
1u8
,
'y'
);
let
(
_
a
,
_
b
)
=
(
&
1u8
,
'y'
);
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_amp_in_pattern
()
{
let
(
&
_
a
,
_
b
)
=
(
&
1u8
,
'y'
);
}
...
...
@@ -159,15 +173,16 @@ pub fn add_amp_in_pattern() {
// Change Mutability of Binding in Pattern -------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_mutability_of_binding_in_pattern
()
{
let
(
_
a
,
_
b
)
=
(
99u8
,
'q'
);
let
(
_
a
,
_
b
)
=
(
99u8
,
'q'
);
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_mutability_of_binding_in_pattern
()
{
let
(
mut
_
a
,
_
b
)
=
(
99u8
,
'q'
);
}
...
...
@@ -175,15 +190,16 @@ pub fn change_mutability_of_binding_in_pattern() {
// Add Initializer -------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_initializer
()
{
let
_
x
:
i16
;
let
_
x
:
i16
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_initializer
()
{
let
_
x
:
i16
=
3i16
;
}
...
...
@@ -191,15 +207,16 @@ pub fn add_initializer() {
// Change Initializer ----------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_initializer
()
{
let
_
x
=
4u16
;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_initializer
()
{
let
_
x
=
5u16
;
}
src/test/incremental/hashes/loop_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -15,7 +21,7 @@
// Change loop body
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_loop_body
()
{
let
mut
_
x
=
0
;
loop
{
...
...
@@ -24,9 +30,11 @@ pub fn change_loop_body() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_loop_body
()
{
let
mut
_
x
=
0
;
loop
{
...
...
@@ -38,17 +46,20 @@ pub fn change_loop_body() {
// Add break
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_break
()
{
let
mut
_
x
=
0
;
loop
{
_
x
=
1
;
//----
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_break
()
{
let
mut
_
x
=
0
;
loop
{
...
...
@@ -60,18 +71,20 @@ pub fn add_break() {
// Add loop label
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_loop_label
()
{
let
mut
_
x
=
0
;
loop
{
/*---*/
loop
{
_
x
=
1
;
break
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_loop_label
()
{
let
mut
_
x
=
0
;
'label
:
loop
{
...
...
@@ -83,18 +96,20 @@ pub fn add_loop_label() {
// Add loop label to break
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_loop_label_to_break
()
{
let
mut
_
x
=
0
;
'label
:
loop
{
_
x
=
1
;
break
;
break
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_loop_label_to_break
()
{
let
mut
_
x
=
0
;
'label
:
loop
{
...
...
@@ -106,7 +121,7 @@ pub fn add_loop_label_to_break() {
// Change break label
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_break_label
()
{
let
mut
_
x
=
0
;
'outer
:
loop
{
...
...
@@ -117,9 +132,11 @@ pub fn change_break_label() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir, typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_break_label
()
{
let
mut
_
x
=
0
;
'outer
:
loop
{
...
...
@@ -133,18 +150,20 @@ pub fn change_break_label() {
// Add loop label to continue
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_loop_label_to_continue
()
{
let
mut
_
x
=
0
;
'label
:
loop
{
_
x
=
1
;
continue
;
continue
;
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_loop_label_to_continue
()
{
let
mut
_
x
=
0
;
'label
:
loop
{
...
...
@@ -156,7 +175,7 @@ pub fn add_loop_label_to_continue() {
// Change continue label
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_continue_label
()
{
let
mut
_
x
=
0
;
'outer
:
loop
{
...
...
@@ -167,9 +186,11 @@ pub fn change_continue_label() {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes, typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, typeck, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_continue_label
()
{
let
mut
_
x
=
0
;
'outer
:
loop
{
...
...
@@ -183,7 +204,7 @@ pub fn change_continue_label() {
// Change continue to break
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_continue_to_break
()
{
let
mut
_
x
=
0
;
loop
{
...
...
@@ -192,13 +213,15 @@ pub fn change_continue_to_break() {
}
}
#[cfg(not(
cfail1
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,
optimized_mir, typeck
"
)]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,
typeck, optimized_mir
"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes, typeck, optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_continue_to_break
()
{
let
mut
_
x
=
0
;
loop
{
_
x
=
1
;
break
;
break
;
}
}
src/test/incremental/hashes/match_expressions.rs
浏览文件 @
11a999e6
...
...
@@ -6,28 +6,35 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type=
"rlib"
]
// Add Arm ---------------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_arm
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
1
=>
1
,
/*---*/
_
=>
100
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_arm
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -40,7 +47,7 @@ pub fn add_arm(x: u32) -> u32 {
// Change Order Of Arms --------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_order_of_arms
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -49,10 +56,11 @@ pub fn change_order_of_arms(x: u32) -> u32 {
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_order_of_arms
(
x
:
u32
)
->
u32
{
match
x
{
1
=>
1
,
...
...
@@ -64,19 +72,20 @@ pub fn change_order_of_arms(x: u32) -> u32 {
// Add Guard Clause ------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_guard_clause
(
x
:
u32
,
y
:
bool
)
->
u32
{
match
x
{
0
=>
0
,
1
=>
1
,
1
=>
1
,
_
=>
100
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_guard_clause
(
x
:
u32
,
y
:
bool
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -88,19 +97,20 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 {
// Change Guard Clause ------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_guard_clause
(
x
:
u32
,
y
:
bool
)
->
u32
{
match
x
{
0
=>
0
,
1
if
y
=>
1
,
1
if
y
=>
1
,
_
=>
100
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_guard_clause
(
x
:
u32
,
y
:
bool
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -112,19 +122,20 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 {
// Add @-Binding ---------------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_at_binding
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
1
=>
1
,
_
=>
x
,
_
=>
x
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_at_binding
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -136,7 +147,7 @@ pub fn add_at_binding(x: u32) -> u32 {
// Change Name of @-Binding ----------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_name_of_at_binding
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -145,10 +156,11 @@ pub fn change_name_of_at_binding(x: u32) -> u32 {
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_name_of_at_binding
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -160,18 +172,19 @@ pub fn change_name_of_at_binding(x: u32) -> u32 {
// Change Simple Binding To Pattern --------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_simple_name_to_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
0
,
0
)
=>
0
,
a
=>
1
,
a
=>
1
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_simple_name_to_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
0
,
0
)
=>
0
,
...
...
@@ -182,7 +195,7 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 {
// Change Name In Pattern ------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_name_in_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
a
,
0
)
=>
0
,
...
...
@@ -191,10 +204,11 @@ pub fn change_name_in_pattern(x: u32) -> u32 {
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_name_in_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
b
,
0
)
=>
0
,
...
...
@@ -206,18 +220,19 @@ pub fn change_name_in_pattern(x: u32) -> u32 {
// Change Mutability Of Binding In Pattern -------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_mutability_of_binding_in_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
a
,
0
)
=>
0
,
(
a
,
0
)
=>
0
,
_
=>
1
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_mutability_of_binding_in_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
mut
a
,
0
)
=>
0
,
...
...
@@ -228,18 +243,19 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
// Add `ref` To Binding In Pattern -------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_ref_to_binding_in_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
a
,
0
)
=>
0
,
(
a
,
0
)
=>
0
,
_
=>
1
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_ref_to_binding_in_pattern
(
x
:
u32
)
->
u32
{
match
(
x
,
x
&
1
)
{
(
ref
a
,
0
)
=>
0
,
...
...
@@ -250,18 +266,19 @@ pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
// Add `&` To Binding In Pattern -------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_amp_to_binding_in_pattern
(
x
:
u32
)
->
u32
{
match
(
&
x
,
x
&
1
)
{
(
a
,
0
)
=>
0
,
(
a
,
0
)
=>
0
,
_
=>
1
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_amp_to_binding_in_pattern
(
x
:
u32
)
->
u32
{
match
(
&
x
,
x
&
1
)
{
(
&
a
,
0
)
=>
0
,
...
...
@@ -272,7 +289,7 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
// Change RHS Of Arm -----------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_rhs_of_arm
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -281,10 +298,11 @@ pub fn change_rhs_of_arm(x: u32) -> u32 {
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_rhs_of_arm
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
...
...
@@ -296,19 +314,20 @@ pub fn change_rhs_of_arm(x: u32) -> u32 {
// Add Alternative To Arm ------------------------------------------------------
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_alternative_to_arm
(
x
:
u32
)
->
u32
{
match
x
{
0
=>
0
,
0
=>
0
,
1
=>
1
,
_
=>
2
,
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_alternative_to_arm
(
x
:
u32
)
->
u32
{
match
x
{
0
|
7
=>
0
,
...
...
src/test/incremental/hashes/statics.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -17,86 +23,102 @@
// Change static visibility
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_VISIBILITY
:
u8
=
0
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner,hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner,hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
static
STATIC_VISIBILITY
:
u8
=
0
;
// Change static mutability
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_MUTABILITY
:
u8
=
0
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner,hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner,hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
mut
STATIC_MUTABILITY
:
u8
=
0
;
// Add linkage attribute
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_LINKAGE
:
u8
=
0
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[linkage=
"weak_odr"
]
static
STATIC_LINKAGE
:
u8
=
0
;
// Add no_mangle attribute
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_NO_MANGLE
:
u8
=
0
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[no_mangle]
static
STATIC_NO_MANGLE
:
u8
=
0
;
// Add thread_local attribute
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_THREAD_LOCAL
:
u8
=
0
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[thread_local]
static
STATIC_THREAD_LOCAL
:
u8
=
0
;
// Change type from i16 to u64
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_CHANGE_TYPE_1
:
i16
=
0
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_TYPE_1
:
u64
=
0
;
// Change type from Option<i8> to Option<u16>
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
static
STATIC_CHANGE_TYPE_2
:
Option
<
i8
>
=
None
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_TYPE_2
:
Option
<
u16
>
=
None
;
// Change value between simple literals
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_VALUE_1
:
i16
=
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
{
1
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
{
2
}
};
...
...
@@ -104,31 +126,37 @@
// Change value between expressions
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_VALUE_2
:
i16
=
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
{
1
+
1
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
{
1
+
2
}
};
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_VALUE_3
:
i16
=
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
{
2
+
3
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
{
2
*
3
}
};
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_VALUE_4
:
i16
=
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
{
1
+
2
*
3
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
{
1
+
2
*
4
}
};
...
...
@@ -138,17 +166,21 @@
struct
ReferencedType2
;
mod
static_change_type_indirectly
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
ReferencedType1
as
Type
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
ReferencedType2
as
Type
;
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_TYPE_INDIRECTLY_1
:
Type
=
Type
;
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner,hir_owner_nodes,type_of"
)]
#[rustc_clean(cfg=
"cfail6"
)]
static
STATIC_CHANGE_TYPE_INDIRECTLY_2
:
Option
<
Type
>
=
None
;
}
src/test/incremental/hashes/struct_constructors.rs
浏览文件 @
11a999e6
...
...
@@ -6,8 +6,14 @@
// rev3 and make sure that the hash has not changed.
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
// compile-flags: -Z query-dep-graph
// [cfail1]compile-flags: -Zincremental-ignore-spans
// [cfail2]compile-flags: -Zincremental-ignore-spans
// [cfail3]compile-flags: -Zincremental-ignore-spans
// [cfail4]compile-flags: -Zincremental-relative-spans
// [cfail5]compile-flags: -Zincremental-relative-spans
// [cfail6]compile-flags: -Zincremental-relative-spans
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
@@ -21,7 +27,7 @@ pub struct RegularStruct {
}
// Change field value (regular struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_value_regular_struct
()
->
RegularStruct
{
RegularStruct
{
x
:
0
,
...
...
@@ -30,9 +36,11 @@ pub fn change_field_value_regular_struct() -> RegularStruct {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_field_value_regular_struct
()
->
RegularStruct
{
RegularStruct
{
x
:
0
,
...
...
@@ -44,7 +52,7 @@ pub fn change_field_value_regular_struct() -> RegularStruct {
// Change field order (regular struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_order_regular_struct
()
->
RegularStruct
{
RegularStruct
{
x
:
3
,
...
...
@@ -53,9 +61,11 @@ pub fn change_field_order_regular_struct() -> RegularStruct {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_field_order_regular_struct
()
->
RegularStruct
{
RegularStruct
{
y
:
4
,
...
...
@@ -67,7 +77,7 @@ pub fn change_field_order_regular_struct() -> RegularStruct {
// Add field (regular struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
add_field_regular_struct
()
->
RegularStruct
{
let
struct1
=
RegularStruct
{
x
:
3
,
...
...
@@ -77,13 +87,16 @@ pub fn add_field_regular_struct() -> RegularStruct {
RegularStruct
{
x
:
7
,
// --
..
struct1
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
add_field_regular_struct
()
->
RegularStruct
{
let
struct1
=
RegularStruct
{
x
:
3
,
...
...
@@ -101,7 +114,7 @@ pub fn add_field_regular_struct() -> RegularStruct {
// Change field label (regular struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_label_regular_struct
()
->
RegularStruct
{
let
struct1
=
RegularStruct
{
x
:
3
,
...
...
@@ -116,9 +129,11 @@ pub fn change_field_label_regular_struct() -> RegularStruct {
}
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_field_label_regular_struct
()
->
RegularStruct
{
let
struct1
=
RegularStruct
{
x
:
3
,
...
...
@@ -142,18 +157,20 @@ pub struct RegularStruct2 {
}
// Change constructor path (regular struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_path_regular_struct
()
{
let
_
=
RegularStruct
{
let
_
=
RegularStruct
{
x
:
0
,
y
:
1
,
z
:
2
,
};
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_path_regular_struct
()
{
let
_
=
RegularStruct2
{
x
:
0
,
...
...
@@ -166,9 +183,9 @@ pub fn change_constructor_path_regular_struct() {
// Change constructor path indirectly (regular struct)
pub
mod
change_constructor_path_indirectly_regular_struct
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
RegularStruct
as
Struct
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
RegularStruct2
as
Struct
;
#[rustc_clean(
...
...
@@ -176,6 +193,11 @@ pub mod change_constructor_path_indirectly_regular_struct {
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(
cfg=
"cfail5"
,
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
function
()
->
Struct
{
Struct
{
x
:
0
,
...
...
@@ -190,14 +212,16 @@ pub fn function() -> Struct {
pub
struct
TupleStruct
(
i32
,
i64
,
i16
);
// Change field value (tuple struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_field_value_tuple_struct
()
->
TupleStruct
{
TupleStruct
(
0
,
1
,
2
)
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,optimized_mir"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_field_value_tuple_struct
()
->
TupleStruct
{
TupleStruct
(
0
,
1
,
3
)
}
...
...
@@ -207,14 +231,16 @@ pub fn change_field_value_tuple_struct() -> TupleStruct {
pub
struct
TupleStruct2
(
u16
,
u16
,
u16
);
// Change constructor path (tuple struct)
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
pub
fn
change_constructor_path_tuple_struct
()
{
let
_
=
TupleStruct
(
0
,
1
,
2
);
let
_
=
TupleStruct
(
0
,
1
,
2
);
}
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
#[rustc_clean(cfg=
"cfail2"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail3"
)]
#[rustc_clean(cfg=
"cfail5"
,
except=
"hir_owner_nodes,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
pub
fn
change_constructor_path_tuple_struct
()
{
let
_
=
TupleStruct2
(
0
,
1
,
2
);
}
...
...
@@ -223,11 +249,16 @@ pub fn change_constructor_path_tuple_struct() {
// Change constructor path indirectly (tuple struct)
pub
mod
change_constructor_path_indirectly_tuple_struct
{
#[cfg(
cfail1
)]
#[cfg(
any(cfail1,cfail4)
)]
use
super
::
TupleStruct
as
Struct
;
#[cfg(not(
cfail1
))]
#[cfg(not(
any(cfail1,cfail4)
))]
use
super
::
TupleStruct2
as
Struct
;
#[rustc_clean(
cfg=
"cfail5"
,
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,typeck"
)]
#[rustc_clean(cfg=
"cfail6"
)]
#[rustc_clean(
cfg=
"cfail2"
,
except=
"fn_sig,hir_owner,hir_owner_nodes,optimized_mir,typeck"
...
...
src/test/incremental/hashes/struct_defs.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/trait_defs.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/trait_impls.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/type_defs.rs
浏览文件 @
11a999e6
...
...
@@ -12,7 +12,7 @@
// build-pass (FIXME(62277): could be check-pass?)
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
-Zincremental-ignore-spans
// compile-flags: -Z query-dep-graph
#![allow(warnings)]
#![feature(rustc_attrs)]
...
...
src/test/incremental/hashes/unary_and_binary_exprs.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/while_let_loops.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/hashes/while_loops.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/spans_significant_w_debuginfo.rs
浏览文件 @
11a999e6
// This test makes sure that just changing a definition's location in the
// source file also changes its incr. comp. hash, if debuginfo is enabled.
// revisions:rpass1 rpass2
// revisions:rpass1 rpass2
rpass3 rpass4
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g -Z query-dep-graph
// [rpass3]compile-flags: -Zincremental-relative-spans
// [rpass4]compile-flags: -Zincremental-relative-spans
#![feature(rustc_attrs)]
#![rustc_partition_codegened(module
=
"spans_significant_w_debuginfo"
,
cfg
=
"rpass2"
)]
#![rustc_partition_codegened(module
=
"spans_significant_w_debuginfo"
,
cfg
=
"rpass4"
)]
#[cfg(
rpass1
)]
#[cfg(
any(rpass1,
rpass3)
)]
pub
fn
main
()
{}
#[cfg(rpass2)]
#[rustc_clean(except=
"hir_owner,hir_owner_nodes,optimized_mir"
,
cfg=
"rpass2"
)]
#[cfg(any(rpass2,
rpass4))]
#[rustc_clean(except
=
"hir_owner,hir_owner_nodes,optimized_mir"
,
cfg
=
"rpass2"
)]
#[rustc_clean(cfg
=
"rpass4"
)]
pub
fn
main
()
{}
src/test/incremental/spans_significant_w_panic.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/string_constant.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
src/test/incremental/thinlto/cgu_keeps_identical_fn.rs
浏览文件 @
11a999e6
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录