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