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