2021-04-22 14:33:16 -05:00
|
|
|
//@ revisions: rpass1 rpass2 rpass3 rpass4
|
2017-09-28 04:58:45 -05:00
|
|
|
//@ compile-flags: -Zquery-dep-graph
|
2021-04-22 14:33:16 -05:00
|
|
|
//@ [rpass1]compile-flags: -Zincremental-ignore-spans
|
|
|
|
//@ [rpass2]compile-flags: -Zincremental-ignore-spans
|
2016-12-09 16:46:31 -06:00
|
|
|
|
|
|
|
#![feature(rustc_attrs)]
|
2021-04-22 14:33:16 -05:00
|
|
|
#![rustc_partition_reused(module = "change_symbol_export_status-mod1", cfg = "rpass2")]
|
2020-03-15 18:43:37 -05:00
|
|
|
#![rustc_partition_reused(module = "change_symbol_export_status-mod2", cfg = "rpass2")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#![rustc_partition_reused(module = "change_symbol_export_status-mod1", cfg = "rpass4")]
|
|
|
|
#![rustc_partition_reused(module = "change_symbol_export_status-mod2", cfg = "rpass4")]
|
2016-12-09 16:46:31 -06:00
|
|
|
|
|
|
|
// This test case makes sure that a change in symbol visibility is detected by
|
|
|
|
// our dependency tracking. We do this by changing a module's visibility to
|
|
|
|
// `private` in rpass2, causing the contained function to go from `default` to
|
|
|
|
// `hidden` visibility.
|
|
|
|
// The function is marked with #[no_mangle] so it is considered for exporting
|
|
|
|
// even from an executable. Plain Rust functions are only exported from Rust
|
|
|
|
// libraries, which our test infrastructure does not support.
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(rpass1,rpass3))]
|
2016-12-09 16:46:31 -06:00
|
|
|
pub mod mod1 {
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn foo() {}
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(rpass2,rpass4))]
|
2016-12-09 16:46:31 -06:00
|
|
|
mod mod1 {
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn foo() {}
|
|
|
|
}
|
|
|
|
|
2017-09-28 04:58:45 -05:00
|
|
|
pub mod mod2 {
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn bar() {}
|
|
|
|
}
|
|
|
|
|
2016-12-09 16:46:31 -06:00
|
|
|
fn main() {
|
|
|
|
mod1::foo();
|
|
|
|
}
|