]> git.proxmox.com Git - rustc.git/blob - tests/incremental/dirty_clean.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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(
29 except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of,fn_sig",
30 cfg="cfail2",
31 )]
32 pub fn y() {
33 //[cfail2]~^ ERROR `hir_owner(y)` should be dirty but is not
34 //[cfail2]~| ERROR `hir_owner_nodes(y)` should be dirty but is not
35 //[cfail2]~| ERROR `generics_of(y)` should be dirty but is not
36 //[cfail2]~| ERROR `predicates_of(y)` should be dirty but is not
37 //[cfail2]~| ERROR `type_of(y)` should be dirty but is not
38 //[cfail2]~| ERROR `fn_sig(y)` should be dirty but is not
39 //[cfail2]~| ERROR `typeck(y)` should be clean but is not
40 x::x();
41 }
42 }
43
44 mod z {
45 #[rustc_clean(except="typeck", cfg="cfail2")]
46 pub fn z() {
47 //[cfail2]~^ ERROR `typeck(z)` should be dirty but is not
48 }
49 }