]> git.lizzy.rs Git - rust.git/blob - tests/incremental/ich_method_call_trait_scope.rs
Migrate `rustc_parse` to derive diagnostics
[rust.git] / tests / 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(except="typeck", cfg="rpass2")]
30     fn bar() {
31         ().method();
32     }
33
34     #[rustc_clean(cfg="rpass2")]
35     fn baz() {
36         22; // no method call, traits in scope don't matter
37     }
38 }
39
40 fn main() { }