]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dep-graph/dep-graph-caller-callee.rs
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / dep-graph / dep-graph-caller-callee.rs
1 // Test that immediate callers have to change when callee changes, but
2 // not callers' callers.
3
4 // incremental
5 // compile-flags: -Z query-dep-graph
6
7 #![feature(rustc_attrs)]
8 #![allow(dead_code)]
9
10 fn main() { }
11
12 mod x {
13     #[rustc_if_this_changed]
14     pub fn x() { }
15 }
16
17 mod y {
18     use x;
19
20     // These dependencies SHOULD exist:
21     #[rustc_then_this_would_need(typeck)] //~ ERROR OK
22     pub fn y() {
23         x::x();
24     }
25 }
26
27 mod z {
28     use y;
29
30     // These are expected to yield errors, because changes to `x`
31     // affect the BODY of `y`, but not its signature.
32     #[rustc_then_this_would_need(typeck)] //~ ERROR no path
33     pub fn z() {
34         y::y();
35     }
36 }