]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/promoted-closure-pair.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / ui / nll / promoted-closure-pair.rs
1 // Check that we handle multiple closures in the same promoted constant.
2
3 #![feature(nll)]
4
5 fn foo() -> &'static i32 {
6     let z = 0;
7     let p = &(|y| y, |y| y);
8     p.0(&z);
9     p.1(&z)         //~ ERROR cannot return
10 }
11
12 fn main() {}