2017-10-27 18:57:15 +02:00
|
|
|
// revisions: cfail1 cfail2
|
2016-08-05 20:14:47 -04:00
|
|
|
// compile-flags: -Z query-dep-graph
|
2018-04-02 13:20:06 +02:00
|
|
|
// compile-pass
|
2016-03-28 17:49:02 -04:00
|
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
|
#![feature(rustc_attrs)]
|
2017-10-27 18:57:15 +02:00
|
|
|
#![crate_type = "rlib"]
|
2016-03-28 17:49:02 -04: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 18:57:15 +02:00
|
|
|
pub mod x {
|
|
|
|
|
#[cfg(cfail1)]
|
2016-03-28 17:49:02 -04:00
|
|
|
pub fn x() {
|
2016-12-21 12:32:59 +02:00
|
|
|
println!("{}", "1");
|
2016-03-28 17:49:02 -04:00
|
|
|
}
|
|
|
|
|
|
2017-10-27 18:57:15 +02:00
|
|
|
#[cfg(cfail2)]
|
|
|
|
|
#[rustc_dirty(label="HirBody", cfg="cfail2")]
|
2019-03-20 16:06:09 +01:00
|
|
|
#[rustc_dirty(label="optimized_mir", cfg="cfail2")]
|
2016-03-28 17:49:02 -04:00
|
|
|
pub fn x() {
|
2016-12-21 12:32:59 +02:00
|
|
|
println!("{}", "2");
|
2016-03-28 17:49:02 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-27 18:57:15 +02:00
|
|
|
pub mod y {
|
2016-03-28 17:49:02 -04:00
|
|
|
use x;
|
|
|
|
|
|
2019-03-29 17:05:40 +01:00
|
|
|
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
|
2019-03-20 16:06:09 +01:00
|
|
|
#[rustc_clean(label="optimized_mir", cfg="cfail2")]
|
2016-03-28 17:49:02 -04:00
|
|
|
pub fn y() {
|
|
|
|
|
x::x();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-27 18:57:15 +02:00
|
|
|
pub mod z {
|
2016-03-28 17:49:02 -04:00
|
|
|
use y;
|
|
|
|
|
|
2019-03-29 17:05:40 +01:00
|
|
|
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
|
2019-03-20 16:06:09 +01:00
|
|
|
#[rustc_clean(label="optimized_mir", cfg="cfail2")]
|
2016-03-28 17:49:02 -04:00
|
|
|
pub fn z() {
|
|
|
|
|
y::y();
|
|
|
|
|
}
|
|
|
|
|
}
|