]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-48697.rs
Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-48697.rs
1 // Regression test for #48697
2
3 fn foo(x: &i32) -> &i32 {
4     let z = 4;
5     let f = &|y| y;
6     let k = f(&z);
7     f(x) //~ cannot return value referencing local variable
8 }
9
10 fn main() {}