]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dep-graph/dep-graph-caller-callee.rs
Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
[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 // compile-flags: -Z query-dep-graph
5
6 #![feature(rustc_attrs)]
7 #![allow(dead_code)]
8
9 fn main() { }
10
11 mod x {
12     #[rustc_if_this_changed]
13     pub fn x() { }
14 }
15
16 mod y {
17     use x;
18
19     // These dependencies SHOULD exist:
20     #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
21     pub fn y() {
22         x::x();
23     }
24 }
25
26 mod z {
27     use y;
28
29     // These are expected to yield errors, because changes to `x`
30     // affect the BODY of `y`, but not its signature.
31     #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
32     pub fn z() {
33         y::y();
34     }
35 }