]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/promoted-closure-pair.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[rust.git] / tests / ui / nll / promoted-closure-pair.rs
1 // Check that we handle multiple closures in the same promoted constant.
2
3 fn foo() -> &'static i32 {
4     let z = 0;
5     let p = &(|y| y, |y| y);
6     p.0(&z);
7     p.1(&z)         //~ ERROR cannot return
8 }
9
10 fn main() {}