2022-10-31 11:43:37 -05:00
|
|
|
// revisions: cfail1 cfail2
|
2016-08-05 19:14:47 -05:00
|
|
|
// compile-flags: -Z query-dep-graph
|
2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2016-03-28 16:49:02 -05:00
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(rustc_attrs)]
|
2017-10-27 11:57:15 -05:00
|
|
|
#![crate_type = "rlib"]
|
2016-03-28 16:49:02 -05:00
|
|
|
|
|
|
|
// Here the only thing which changes is the string constant in `x`.
|
|
|
|
// Therefore, the compiler deduces (correctly) that typeck is not
|
|
|
|
// needed even for callers of `x`.
|
|
|
|
|
2017-10-27 11:57:15 -05:00
|
|
|
pub mod x {
|
2022-10-31 11:43:37 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-03-28 16:49:02 -05:00
|
|
|
pub fn x() {
|
2016-12-21 04:32:59 -06:00
|
|
|
println!("{}", "1");
|
2016-03-28 16:49:02 -05:00
|
|
|
}
|
|
|
|
|
2022-10-31 11:43:37 -05:00
|
|
|
#[cfg(cfail2)]
|
|
|
|
#[rustc_clean(except = "hir_owner_nodes,promoted_mir", cfg = "cfail2")]
|
2016-03-28 16:49:02 -05:00
|
|
|
pub fn x() {
|
2016-12-21 04:32:59 -06:00
|
|
|
println!("{}", "2");
|
2016-03-28 16:49:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 11:57:15 -05:00
|
|
|
pub mod y {
|
2016-03-28 16:49:02 -05:00
|
|
|
use x;
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2016-03-28 16:49:02 -05:00
|
|
|
pub fn y() {
|
|
|
|
x::x();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 11:57:15 -05:00
|
|
|
pub mod z {
|
2016-03-28 16:49:02 -05:00
|
|
|
use y;
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg = "cfail2")]
|
2016-03-28 16:49:02 -05:00
|
|
|
pub fn z() {
|
|
|
|
y::y();
|
|
|
|
}
|
|
|
|
}
|