Files
Zalathar 0ea8958c02 Migrate bfail/build-pass tests to bpass (2/2)
This is the subset of incremental tests that have a FIXME to consider migrating
to check-pass instead.

That migration is beyond the scope of this PR, but might be attempted later.
2026-04-22 12:28:25 +10:00

46 lines
892 B
Rust

// Regression test for #42602. It used to be that we had
// a dep-graph like
//
// typeck_root(foo) -> FnOnce -> typeck_root(bar)
//
// This was fixed by improving the resolution of the `FnOnce` trait
// selection node.
//@ revisions: bpass1 bpass2 bpass3
//@ compile-flags:-Zquery-dep-graph
//@ ignore-backends: gcc
// FIXME(#62277): could be check-pass?
#![feature(rustc_attrs)]
fn main() {
a::foo();
b::bar();
}
mod a {
#[cfg(bpass1)]
pub fn foo() {
let x = vec![1, 2, 3];
let v = || ::std::mem::drop(x);
v();
}
#[cfg(not(bpass1))]
pub fn foo() {
let x = vec![1, 2, 3, 4];
let v = || ::std::mem::drop(x);
v();
}
}
mod b {
#[rustc_clean(cfg="bpass2")]
#[rustc_clean(cfg="bpass3")]
pub fn bar() {
let x = vec![1, 2, 3];
let v = || ::std::mem::drop(x);
v();
}
}