]> git.proxmox.com Git - rustc.git/blob - src/test/incremental/ich_resolve_results.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / incremental / ich_resolve_results.rs
1 // Check that the hash for `mod3::bar` changes when we change the
2 // `use` to something different.
3
4 // revisions: rpass1 rpass2 rpass3
5
6 #![feature(rustc_attrs)]
7
8 fn test<T>() { }
9
10 mod mod1 {
11 pub struct Foo(pub u32);
12 }
13
14 mod mod2 {
15 pub struct Foo(pub i64);
16 }
17
18 mod mod3 {
19 #[cfg(rpass1)]
20 use mod1::Foo;
21 use test;
22
23 // In rpass2 we move the use declaration.
24 #[cfg(rpass2)]
25 use mod1::Foo;
26
27 // In rpass3 we let the declaration point to something else.
28 #[cfg(rpass3)]
29 use mod2::Foo;
30
31 #[rustc_clean(label="hir_owner", cfg="rpass2")]
32 #[rustc_clean(label="hir_owner_nodes", cfg="rpass2")]
33 #[rustc_clean(label="hir_owner", cfg="rpass3")]
34 #[rustc_dirty(label="hir_owner_nodes", cfg="rpass3")]
35 fn in_expr() {
36 Foo(0);
37 }
38
39 #[rustc_clean(label="hir_owner", cfg="rpass2")]
40 #[rustc_clean(label="hir_owner_nodes", cfg="rpass2")]
41 #[rustc_clean(label="hir_owner", cfg="rpass3")]
42 #[rustc_dirty(label="hir_owner_nodes", cfg="rpass3")]
43 fn in_type() {
44 test::<Foo>();
45 }
46 }
47
48 fn main() { }