]> git.lizzy.rs Git - rust.git/blob - tests/incremental/string_constant.rs
Migrate `rustc_parse` to derive diagnostics
[rust.git] / tests / 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 pub mod x {
14     #[cfg(cfail1)]
15     pub fn x() {
16         println!("{}", "1");
17     }
18
19     #[cfg(cfail2)]
20     #[rustc_clean(except = "hir_owner_nodes,promoted_mir", cfg = "cfail2")]
21     pub fn x() {
22         println!("{}", "2");
23     }
24 }
25
26 pub mod y {
27     use x;
28
29     #[rustc_clean(cfg = "cfail2")]
30     pub fn y() {
31         x::x();
32     }
33 }
34
35 pub mod z {
36     use y;
37
38     #[rustc_clean(cfg = "cfail2")]
39     pub fn z() {
40         y::y();
41     }
42 }