]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/issue-38222.rs
Auto merge of #54497 - ralexstokes:stabilize_pattern_parentheses, r=nikomatsakis
[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 // compile-flags: -Z query-dep-graph
16
17
18 #![feature(rustc_attrs)]
19
20
21 #![rustc_partition_reused(module="issue_38222-mod1", cfg="rpass2")]
22
23 // If codegen had added a dependency edge to the Krate dep-node, nothing would
24 // be re-used, so checking that this module was re-used is sufficient.
25 #![rustc_partition_reused(module="issue_38222", cfg="rpass2")]
26
27 //[rpass1] compile-flags: -C debuginfo=1
28 //[rpass2] compile-flags: -C debuginfo=1
29
30 pub fn main() {
31     mod1::some_fn();
32 }
33
34 mod mod1 {
35     pub fn some_fn() {
36         #[cfg(rpass2)]
37         {}
38
39         let _ = 1;
40     }
41 }