]>
git.proxmox.com Git - rustc.git/blob - tests/incremental/hashes/indexing_expressions.rs
1 // This test case tests the incremental compilation hash (ICH) implementation
2 // for indexing expression.
4 // The general pattern followed here is: Change one thing between rev1 and rev2
5 // and make sure that the hash has changed, then change nothing between rev2 and
6 // rev3 and make sure that the hash has not changed.
8 // build-pass (FIXME(62277): could be check-pass?)
9 // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
10 // compile-flags: -Z query-dep-graph -O
11 // [cfail1]compile-flags: -Zincremental-ignore-spans
12 // [cfail2]compile-flags: -Zincremental-ignore-spans
13 // [cfail3]compile-flags: -Zincremental-ignore-spans
16 #![feature(rustc_attrs)]
19 // Change simple index
20 #[cfg(any(cfail1,cfail4))]
21 fn change_simple_index(slice
: &[u32]) -> u32 {
25 #[cfg(not(any(cfail1,cfail4)))]
26 #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")]
27 #[rustc_clean(cfg="cfail3")]
28 #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")]
29 #[rustc_clean(cfg="cfail6")]
30 fn change_simple_index(slice
: &[u32]) -> u32 {
37 #[cfg(any(cfail1,cfail4))]
38 fn change_lower_bound(slice
: &[u32]) -> &[u32] {
42 #[cfg(not(any(cfail1,cfail4)))]
43 #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")]
44 #[rustc_clean(cfg="cfail3")]
45 #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")]
46 #[rustc_clean(cfg="cfail6")]
47 fn change_lower_bound(slice
: &[u32]) -> &[u32] {
54 #[cfg(any(cfail1,cfail4))]
55 fn change_upper_bound(slice
: &[u32]) -> &[u32] {
59 #[cfg(not(any(cfail1,cfail4)))]
60 #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")]
61 #[rustc_clean(cfg="cfail3")]
62 #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")]
63 #[rustc_clean(cfg="cfail6")]
64 fn change_upper_bound(slice
: &[u32]) -> &[u32] {
71 #[cfg(any(cfail1,cfail4))]
72 fn add_lower_bound(slice
: &[u32]) -> &[u32] {
76 #[cfg(not(any(cfail1,cfail4)))]
77 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail2")]
78 #[rustc_clean(cfg="cfail3")]
79 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail5")]
80 #[rustc_clean(cfg="cfail6")]
81 fn add_lower_bound(slice
: &[u32]) -> &[u32] {
88 #[cfg(any(cfail1,cfail4))]
89 fn add_upper_bound(slice
: &[u32]) -> &[u32] {
93 #[cfg(not(any(cfail1,cfail4)))]
94 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail2")]
95 #[rustc_clean(cfg="cfail3")]
96 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail5")]
97 #[rustc_clean(cfg="cfail6")]
98 fn add_upper_bound(slice
: &[u32]) -> &[u32] {
105 #[cfg(any(cfail1,cfail4))]
106 fn change_mutability(slice
: &mut [u32]) -> u32 {
107 (&mut slice
[3..5])[0]
110 #[cfg(not(any(cfail1,cfail4)))]
111 #[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail2")]
112 #[rustc_clean(cfg="cfail3")]
113 #[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail5")]
114 #[rustc_clean(cfg="cfail6")]
115 fn change_mutability(slice
: &mut [u32]) -> u32 {
121 // Exclusive to inclusive range
122 #[cfg(any(cfail1,cfail4))]
123 fn exclusive_to_inclusive_range(slice
: &[u32]) -> &[u32] {
127 #[cfg(not(any(cfail1,cfail4)))]
128 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail2")]
129 #[rustc_clean(cfg="cfail3")]
130 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail5")]
131 #[rustc_clean(cfg="cfail6")]
132 fn exclusive_to_inclusive_range(slice
: &[u32]) -> &[u32] {