1
Fork 0
rust/tests/ui/async-await/async-closures/tainted-body-2.rs
2024-12-13 00:04:56 +00:00

16 lines
477 B
Rust

//@ edition: 2021
// Ensure that building a by-ref async closure body doesn't ICE when the parent
// body is tainted.
fn main() {
missing;
//~^ ERROR cannot find value `missing` in this scope
// We don't do numerical inference fallback when the body is tainted.
// This leads to writeback folding the type of the coroutine-closure
// into an error type, since its signature contains that numerical
// infer var.
let c = async |_| {};
c(1);
}