mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
11 lines
218 B
Rust
11 lines
218 B
Rust
// Check that we handle multiple closures in the same promoted constant.
|
|
|
|
fn foo() -> &'static i32 {
|
|
let z = 0;
|
|
let p = &(|y| y, |y| y);
|
|
p.0(&z);
|
|
p.1(&z) //~ ERROR cannot return
|
|
}
|
|
|
|
fn main() {}
|