rust/tests/ui/dep-graph/dep-graph-caller-callee.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
669 B
Rust
Raw Normal View History

// Test that immediate callers have to change when callee changes, but
// not callers' callers.
// incremental
// compile-flags: -Z query-dep-graph
#![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 03:47:04 -05:00
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
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 03:47:04 -05:00
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
pub fn z() {
y::y();
}
}