Files
rust/tests/incremental/clean.rs
Nicholas Nethercote ff161b18b5 Many "predicate"-to-"clause" renamings
Lots of names weren't changed to account for the introduction of the
`Clause` type as a specialized form of `Predicate`, presumably because
it was tedious. This commit converts as many of them as I could find.
It's mostly very tedious renamings of types, functions, variables, and
queries. The more interesting ones are a couple of files
(`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass
(`ImpossiblePredicates`).
2026-07-28 11:48:45 +10:00

50 lines
1.2 KiB
Rust

//@ revisions: rpass1 bfail2
//@ compile-flags: -Z query-dep-graph
//@ ignore-backends: gcc
#![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(bfail2)]
pub fn x() -> u32 {
22
}
}
mod y {
use x;
#[rustc_clean(
except="hir_owner,generics_of,clauses_of,type_of,fn_sig",
cfg="bfail2",
)]
pub fn y() {
//[bfail2]~^ ERROR `hir_owner(y)` should be dirty but is not
//[bfail2]~| ERROR `generics_of(y)` should be dirty but is not
//[bfail2]~| ERROR `clauses_of(y)` should be dirty but is not
//[bfail2]~| ERROR `type_of(y)` should be dirty but is not
//[bfail2]~| ERROR `fn_sig(y)` should be dirty but is not
//[bfail2]~| ERROR `typeck_root(y)` should be clean but is not
x::x();
}
}
mod z {
#[rustc_clean(except="typeck_root", cfg="bfail2")]
pub fn z() {
//[bfail2]~^ ERROR `typeck_root(z)` should be dirty but is not
}
}