]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/dirty_clean.rs
Rollup merge of #83671 - JohnTitor:issue-75801-test, r=Dylan-DPC
[rust.git] / src / test / incremental / dirty_clean.rs
1 // revisions: rpass1 cfail2
2 // compile-flags: -Z query-dep-graph
3
4 #![allow(warnings)]
5 #![feature(rustc_attrs)]
6
7 // Sanity check for the dirty-clean system. Give the opposite
8 // annotations that we expect to see, so that we check that errors are
9 // reported.
10
11 fn main() { }
12
13 mod x {
14     #[cfg(rpass1)]
15     pub fn x() -> usize {
16         22
17     }
18
19     #[cfg(cfail2)]
20     pub fn x() -> u32 {
21         22
22     }
23 }
24
25 mod y {
26     use x;
27
28     #[rustc_clean(label="typeck", cfg="cfail2")]
29     pub fn y() {
30         //[cfail2]~^ ERROR `typeck(y)` should be clean but is not
31         x::x();
32     }
33 }
34
35 mod z {
36     #[rustc_dirty(label="typeck", cfg="cfail2")]
37     pub fn z() {
38         //[cfail2]~^ ERROR `typeck(z)` should be dirty but is not
39     }
40 }