summaryrefslogtreecommitdiffstats
path: root/src/test/ui/span/issue-15480.rs
blob: 916ce4b1edb266330b8972fc2fa127acc321ed6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// run-rustfix
fn id<T>(x: T) -> T { x }

fn main() {
    let v = vec![
        &id(3)
    ];
    //~^^ ERROR temporary value dropped while borrowed

    for &&x in &v {
        println!("{}", x + 3);
    }
}