2022-10-31 11:43:37 -05:00
|
|
|
//@ revisions: cfail1 cfail2
|
2023-12-22 15:44:21 -06:00
|
|
|
//@ compile-flags: -Z query-dep-graph -Copt-level=0
|
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)]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except = "opt_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();
|
|
|
|
}
|
|
|
|
}
|