]> git.lizzy.rs Git - rust.git/blob - tests/incremental/ich_resolve_results.rs
Rollup merge of #96763 - Abdur-rahmaanJ:patch-1, r=Mark-Simulacrum
[rust.git] / tests / 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(cfg="rpass2")]
33     #[rustc_clean(except="hir_owner_nodes,typeck", cfg="rpass3")]
34     fn in_expr() {
35         Foo(0);
36     }
37
38     #[rustc_clean(cfg="rpass2")]
39     #[rustc_clean(except="hir_owner_nodes,typeck", cfg="rpass3")]
40     fn in_type() {
41         test::<Foo>();
42     }
43 }
44
45 fn main() { }