2016-01-06 16:29:00 +00:00
|
|
|
// Test that immediate callers have to change when callee changes, but
|
|
|
|
// not callers' callers.
|
|
|
|
|
2021-09-19 16:57:19 +00:00
|
|
|
// incremental
|
|
|
|
// compile-flags: -Z query-dep-graph
|
2015-12-22 22:17:27 +00:00
|
|
|
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
fn main() { }
|
|
|
|
|
|
|
|
mod x {
|
|
|
|
#[rustc_if_this_changed]
|
|
|
|
pub fn x() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
mod y {
|
|
|
|
use x;
|
|
|
|
|
|
|
|
// These dependencies SHOULD exist:
|
2020-07-17 08:47:04 +00:00
|
|
|
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
2015-12-22 22:17:27 +00:00
|
|
|
pub fn y() {
|
|
|
|
x::x();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod z {
|
|
|
|
use y;
|
|
|
|
|
|
|
|
// These are expected to yield errors, because changes to `x`
|
|
|
|
// affect the BODY of `y`, but not its signature.
|
2020-07-17 08:47:04 +00:00
|
|
|
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
|
2015-12-22 22:17:27 +00:00
|
|
|
pub fn z() {
|
|
|
|
y::y();
|
|
|
|
}
|
|
|
|
}
|