]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/promoted-closure-pair.rs
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / 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() {}