]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/ich_resolve_results.rs
Merge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyup
[rust.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 // compile-flags: -Z query-dep-graph
6
7 #![feature(rustc_attrs)]
8
9 fn test<T>() { }
10
11 mod mod1 {
12     pub struct Foo(pub u32);
13 }
14
15 mod mod2 {
16     pub struct Foo(pub i64);
17 }
18
19 mod mod3 {
20     #[cfg(rpass1)]
21     use mod1::Foo;
22     use test;
23
24     // In rpass2 we move the use declaration.
25     #[cfg(rpass2)]
26     use mod1::Foo;
27
28     // In rpass3 we let the declaration point to something else.
29     #[cfg(rpass3)]
30     use mod2::Foo;
31
32     #[rustc_clean(label="hir_owner", cfg="rpass2")]
33     #[rustc_clean(label="hir_owner_nodes", cfg="rpass2")]
34     #[rustc_clean(label="hir_owner", cfg="rpass3")]
35     #[rustc_dirty(label="hir_owner_nodes", cfg="rpass3")]
36     fn in_expr() {
37         Foo(0);
38     }
39
40     #[rustc_clean(label="hir_owner", cfg="rpass2")]
41     #[rustc_clean(label="hir_owner_nodes", cfg="rpass2")]
42     #[rustc_clean(label="hir_owner", cfg="rpass3")]
43     #[rustc_dirty(label="hir_owner_nodes", cfg="rpass3")]
44     fn in_type() {
45         test::<Foo>();
46     }
47 }
48
49 fn main() { }