]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/ich_resolve_results.rs
Auto merge of #54497 - ralexstokes:stabilize_pattern_parentheses, r=nikomatsakis
[rust.git] / src / test / incremental / ich_resolve_results.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Check that the hash for `mod3::bar` changes when we change the
12 // `use` to something different.
13
14 // revisions: rpass1 rpass2 rpass3
15
16 #![feature(rustc_attrs)]
17
18 fn test<T>() { }
19
20 mod mod1 {
21     pub struct Foo(pub u32);
22 }
23
24 mod mod2 {
25     pub struct Foo(pub i64);
26 }
27
28 mod mod3 {
29     #[cfg(rpass1)]
30     use mod1::Foo;
31     use test;
32
33     // In rpass2 we move the use declaration.
34     #[cfg(rpass2)]
35     use mod1::Foo;
36
37     // In rpass3 we let the declaration point to something else.
38     #[cfg(rpass3)]
39     use mod2::Foo;
40
41     #[rustc_clean(label="Hir", cfg="rpass2")]
42     #[rustc_clean(label="HirBody", cfg="rpass2")]
43     #[rustc_clean(label="Hir", cfg="rpass3")]
44     #[rustc_dirty(label="HirBody", cfg="rpass3")]
45     fn in_expr() {
46         Foo(0);
47     }
48
49     #[rustc_clean(label="Hir", cfg="rpass2")]
50     #[rustc_clean(label="HirBody", cfg="rpass2")]
51     #[rustc_clean(label="Hir", cfg="rpass3")]
52     #[rustc_dirty(label="HirBody", cfg="rpass3")]
53     fn in_type() {
54         test::<Foo>();
55     }
56 }
57
58 fn main() { }