]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/unchecked_dirty_clean.rs
Auto merge of #57035 - Zoxc:query-pref9, r=michaelwoerister
[rust.git] / src / test / incremental / unchecked_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. We add #[rustc_dirty]/#[rustc_clean]
8 // attributes in places that are not checked and make sure that this causes an
9 // error.
10
11 fn main() {
12
13     #[rustc_dirty(label="Hir", cfg="cfail2")]
14     //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
15     {
16         // empty block
17     }
18
19     #[rustc_clean(label="Hir", cfg="cfail2")]
20     //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
21     {
22         // empty block
23     }
24 }
25
26 struct _Struct {
27     #[rustc_dirty(label="Hir", cfg="cfail2")]
28     //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
29     _field1: i32,
30
31     #[rustc_clean(label="Hir", cfg="cfail2")]
32     //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
33     _field2: i32,
34 }