2016-08-24 10:00:55 -05:00
|
|
|
// Regr. test that using HIR inlined from another krate does *not* add
|
2020-02-06 05:46:26 -06:00
|
|
|
// a dependency from the local hir_crate node. We can't easily test that
|
2017-06-08 12:22:57 -05:00
|
|
|
// directly anymore, so now we test that we get reuse.
|
2016-08-24 10:00:55 -05:00
|
|
|
|
2017-06-08 12:22:57 -05:00
|
|
|
// revisions: rpass1 rpass2
|
2016-08-24 06:35:49 -05:00
|
|
|
// compile-flags: -Z query-dep-graph
|
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(rustc_attrs)]
|
2020-02-06 05:46:26 -06:00
|
|
|
#![rustc_partition_reused(module = "krate_inlined-x", cfg = "rpass2")]
|
2016-08-24 10:00:55 -05:00
|
|
|
|
2017-06-08 12:22:57 -05:00
|
|
|
fn main() {
|
2017-10-27 11:57:15 -05:00
|
|
|
x::method();
|
|
|
|
|
2017-06-08 12:22:57 -05:00
|
|
|
#[cfg(rpass2)]
|
|
|
|
()
|
|
|
|
}
|
2016-08-24 06:35:49 -05:00
|
|
|
|
|
|
|
mod x {
|
2017-10-27 11:57:15 -05:00
|
|
|
pub fn method() {
|
2016-08-24 06:35:49 -05:00
|
|
|
// use some methods that require inlining HIR from another crate:
|
|
|
|
let mut v = vec![];
|
|
|
|
v.push(1);
|
|
|
|
}
|
|
|
|
}
|