]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/issue-38222.rs
d14b1cfd6c9ac041202e4645286bffbb6b9b5234
[rust.git] / src / test / incremental / issue-38222.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Test that debuginfo does not introduce a dependency edge to the Krate
12 // dep-node.
13
14 // revisions:rpass1 rpass2
15
16 #![feature(rustc_attrs)]
17
18
19 #![rustc_partition_translated(module="issue_38222-mod1", cfg="rpass2")]
20
21 // If trans had added a dependency edge to the Krate dep-node, nothing would
22 // be re-used, so checking that this module was re-used is sufficient.
23 #![rustc_partition_reused(module="issue_38222", cfg="rpass2")]
24
25 //[rpass1] compile-flags: -C debuginfo=1
26 //[rpass2] compile-flags: -C debuginfo=1
27
28 pub fn main() {
29     mod1::some_fn();
30 }
31
32 mod mod1 {
33     pub fn some_fn() {
34         let _ = 1;
35     }
36
37     #[cfg(rpass2)]
38     fn _some_other_fn() {
39     }
40 }