]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/ich_method_call_trait_scope.rs
Rollup merge of #62310 - GuillaumeGomez:add-missing-doc-links-boxed, r=Centril
[rust.git] / src / test / incremental / ich_method_call_trait_scope.rs
1 // Check that the hash for a method call is sensitive to the traits in
2 // scope.
3
4 // revisions: rpass1 rpass2
5 // compile-flags: -Z query-dep-graph
6
7 #![feature(rustc_attrs)]
8
9 fn test<T>() { }
10
11 trait Trait1 {
12     fn method(&self) { }
13 }
14
15 impl Trait1 for () { }
16
17 trait Trait2 {
18     fn method(&self) { }
19 }
20
21 impl Trait2 for () { }
22
23 mod mod3 {
24     #[cfg(rpass1)]
25     use Trait1;
26     #[cfg(rpass2)]
27     use Trait2;
28
29     #[rustc_clean(label="Hir", cfg="rpass2")]
30     #[rustc_clean(label="HirBody", cfg="rpass2")]
31     #[rustc_dirty(label="typeck_tables_of", cfg="rpass2")]
32     fn bar() {
33         ().method();
34     }
35
36     #[rustc_clean(label="Hir", cfg="rpass2")]
37     #[rustc_clean(label="HirBody", cfg="rpass2")]
38     #[rustc_clean(label="typeck_tables_of", cfg="rpass2")]
39     fn baz() {
40         22; // no method call, traits in scope don't matter
41     }
42 }
43
44 fn main() { }