Files
rust/tests/incremental/string_constant.rs
T
Zalathar 72abf370bb Rename incremental cfail/cpass revisions to bfail/bpass
Long ago, UI tests were divided into "compile" and "run" tests. Later, the
compile tests were further subdivided into "check" and "build" tests, to speed
up tests that don't need a full build.

The same split was never applied to incremental test revisions, so the only way
to perform a check build in incremental tests is (confusingly) to use a `cfail`
revision and then specify `//@ check-fail` or `//@ check-pass`.

This PR makes room for dedicated check-fail and check-pass revisions by
renaming the existing `cfail` and `cpass` revisions to `bfail` and `bpass`,
since they currently perform a full build.
2026-04-18 18:13:17 +10:00

43 lines
819 B
Rust

//@ revisions: bfail1 bfail2
//@ compile-flags: -Z query-dep-graph -Copt-level=0
//@ build-pass (FIXME(62277): could be check-pass?)
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type = "rlib"]
// Here the only thing which changes is the string constant in `x`.
// Therefore, the compiler deduces (correctly) that typeck_root is not
// needed even for callers of `x`.
pub mod x {
#[cfg(bfail1)]
pub fn x() {
println!("{}", "1");
}
#[cfg(bfail2)]
#[rustc_clean(except = "opt_hir_owner_nodes,optimized_mir", cfg = "bfail2")]
pub fn x() {
println!("{}", "2");
}
}
pub mod y {
use x;
#[rustc_clean(cfg = "bfail2")]
pub fn y() {
x::x();
}
}
pub mod z {
use y;
#[rustc_clean(cfg = "bfail2")]
pub fn z() {
y::y();
}
}