]> git.proxmox.com Git - rustc.git/blob - src/test/incremental/string_constant.rs
New upstream version 1.54.0+dfsg1
[rustc.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_clean(except="hir_owner,hir_owner_nodes,optimized_mir,promoted_mir", cfg="cfail2")]
22 pub fn x() {
23 println!("{}", "2");
24 }
25 }
26
27 pub mod y {
28 use x;
29
30 #[rustc_clean(cfg="cfail2")]
31 pub fn y() {
32 x::x();
33 }
34 }
35
36 pub mod z {
37 use y;
38
39 #[rustc_clean(cfg="cfail2")]
40 pub fn z() {
41 y::y();
42 }
43 }