]> git.lizzy.rs Git - rust.git/blob - tests/incremental/unchecked_dirty_clean.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / 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_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_clean(except="hir_owner", cfg="cfail2")]
14     //[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
15     {
16         // empty block
17     }
18
19     #[rustc_clean(cfg="cfail2")]
20     //[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
21     {
22         // empty block
23     }
24 }
25
26 struct _Struct {
27     #[rustc_clean(except="hir_owner", cfg="cfail2")]
28     //[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
29     _field1: i32,
30
31     #[rustc_clean(cfg="cfail2")]
32     //[cfail2]~^ ERROR found unchecked `#[rustc_clean]` attribute
33     _field2: i32,
34 }