2016-03-28 21:49:02 +00:00
|
|
|
//@ revisions: rpass1 cfail2
|
2016-08-06 00:14:47 +00:00
|
|
|
//@ compile-flags: -Z query-dep-graph
|
2016-03-28 21:49:02 +00:00
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
// Sanity check for the dirty-clean system. Give the opposite
|
|
|
|
// annotations that we expect to see, so that we check that errors are
|
|
|
|
// reported.
|
|
|
|
|
|
|
|
fn main() { }
|
|
|
|
|
|
|
|
mod x {
|
|
|
|
#[cfg(rpass1)]
|
|
|
|
pub fn x() -> usize {
|
|
|
|
22
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(cfail2)]
|
|
|
|
pub fn x() -> u32 {
|
|
|
|
22
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod y {
|
|
|
|
use x;
|
|
|
|
|
2021-05-16 08:14:57 +00:00
|
|
|
#[rustc_clean(
|
2024-01-25 16:16:38 +00:00
|
|
|
except="opt_hir_owner_nodes,generics_of,predicates_of,type_of,fn_sig",
|
2021-05-16 08:14:57 +00:00
|
|
|
cfg="cfail2",
|
|
|
|
)]
|
2016-03-28 21:49:02 +00:00
|
|
|
pub fn y() {
|
2024-01-25 16:16:38 +00:00
|
|
|
//[cfail2]~^ ERROR `opt_hir_owner_nodes(y)` should be dirty but is not
|
2021-05-15 11:20:42 +00:00
|
|
|
//[cfail2]~| ERROR `generics_of(y)` should be dirty but is not
|
|
|
|
//[cfail2]~| ERROR `predicates_of(y)` should be dirty but is not
|
|
|
|
//[cfail2]~| ERROR `type_of(y)` should be dirty but is not
|
|
|
|
//[cfail2]~| ERROR `fn_sig(y)` should be dirty but is not
|
|
|
|
//[cfail2]~| ERROR `typeck(y)` should be clean but is not
|
2016-03-28 21:49:02 +00:00
|
|
|
x::x();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod z {
|
2021-05-15 11:20:42 +00:00
|
|
|
#[rustc_clean(except="typeck", cfg="cfail2")]
|
2016-03-28 21:49:02 +00:00
|
|
|
pub fn z() {
|
2020-09-02 07:40:56 +00:00
|
|
|
//[cfail2]~^ ERROR `typeck(z)` should be dirty but is not
|
2016-03-28 21:49:02 +00:00
|
|
|
}
|
|
|
|
}
|