summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-58053.rs
blob: d5a2fa1a3faf9a9686a7e537cb87e3ad39e2184a (plain)
1
2
3
4
5
6
7
8
9
10
11
fn main() {
    let i = &3;

    let f = |x: &i32| -> &i32 { x };
    //~^ ERROR lifetime may not live long enough
    let j = f(i);

    let g = |x: &i32| { x };
    //~^ ERROR lifetime may not live long enough
    let k = g(i);
}