]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/string_constant.rs
Rollup merge of #74204 - ayazhafiz:i/74120, r=eddyb
[rust.git] / src / test / incremental / string_constant.rs
1 // revisions: cfail1 cfail2
2 // compile-flags: -Z query-dep-graph
3 // build-pass (FIXME(62277): could be check-pass?)
4
5 #![allow(warnings)]
6 #![feature(rustc_attrs)]
7 #![crate_type = "rlib"]
8
9 // Here the only thing which changes is the string constant in `x`.
10 // Therefore, the compiler deduces (correctly) that typeck is not
11 // needed even for callers of `x`.
12
13
14 pub mod x {
15     #[cfg(cfail1)]
16     pub fn x() {
17         println!("{}", "1");
18     }
19
20     #[cfg(cfail2)]
21     #[rustc_dirty(label="hir_owner_nodes", cfg="cfail2")]
22     #[rustc_dirty(label="optimized_mir", cfg="cfail2")]
23     pub fn x() {
24         println!("{}", "2");
25     }
26 }
27
28 pub mod y {
29     use x;
30
31     #[rustc_clean(label="typeck", cfg="cfail2")]
32     #[rustc_clean(label="optimized_mir", cfg="cfail2")]
33     pub fn y() {
34         x::x();
35     }
36 }
37
38 pub mod z {
39     use y;
40
41     #[rustc_clean(label="typeck", cfg="cfail2")]
42     #[rustc_clean(label="optimized_mir", cfg="cfail2")]
43     pub fn z() {
44         y::y();
45     }
46 }