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