]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/issue-52534.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / issue-52534.rs
1 fn foo(_: impl FnOnce(&u32) -> &u32) {
2 }
3
4 fn baz(_: impl FnOnce(&u32, u32) -> &u32) {
5 }
6
7 fn bar() {
8     let x = 22;
9     foo(|a| &x)
10 //~^ ERROR does not live long enough
11 }
12
13 fn foobar() {
14     let y = 22;
15     baz(|first, second| &y)
16 //~^ ERROR does not live long enough
17 }
18
19 fn main() { }