]>
git.proxmox.com Git - rustc.git/blob - src/test/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
10 // compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
13 #![feature(rustc_attrs)]
16 // Change simple index
18 fn change_simple_index(slice
: &[u32]) -> u32 {
23 #[rustc_clean(label="hir_owner", cfg="cfail2")]
24 #[rustc_clean(label="hir_owner", cfg="cfail3")]
25 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
26 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
27 fn change_simple_index(slice
: &[u32]) -> u32 {
35 fn change_lower_bound(slice
: &[u32]) -> &[u32] {
40 #[rustc_clean(label="hir_owner", cfg="cfail2")]
41 #[rustc_clean(label="hir_owner", cfg="cfail3")]
42 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
43 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
44 fn change_lower_bound(slice
: &[u32]) -> &[u32] {
52 fn change_upper_bound(slice
: &[u32]) -> &[u32] {
57 #[rustc_clean(label="hir_owner", cfg="cfail2")]
58 #[rustc_clean(label="hir_owner", cfg="cfail3")]
59 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
60 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
61 fn change_upper_bound(slice
: &[u32]) -> &[u32] {
69 fn add_lower_bound(slice
: &[u32]) -> &[u32] {
74 #[rustc_clean(label="hir_owner", cfg="cfail2")]
75 #[rustc_clean(label="hir_owner", cfg="cfail3")]
76 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
77 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
78 fn add_lower_bound(slice
: &[u32]) -> &[u32] {
86 fn add_upper_bound(slice
: &[u32]) -> &[u32] {
91 #[rustc_clean(label="hir_owner", cfg="cfail2")]
92 #[rustc_clean(label="hir_owner", cfg="cfail3")]
93 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
94 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
95 fn add_upper_bound(slice
: &[u32]) -> &[u32] {
103 fn change_mutability(slice
: &mut [u32]) -> u32 {
104 (&mut slice
[3..5])[0]
108 #[rustc_clean(label="hir_owner", cfg="cfail2")]
109 #[rustc_clean(label="hir_owner", cfg="cfail3")]
110 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
111 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
112 fn change_mutability(slice
: &mut [u32]) -> u32 {
118 // Exclusive to inclusive range
120 fn exclusive_to_inclusive_range(slice
: &[u32]) -> &[u32] {
125 #[rustc_clean(label="hir_owner", cfg="cfail2")]
126 #[rustc_clean(label="hir_owner", cfg="cfail3")]
127 #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
128 #[rustc_clean(label="hir_owner_nodes", cfg="cfail3")]
129 fn exclusive_to_inclusive_range(slice
: &[u32]) -> &[u32] {