blob: e6d1a4dd32806e4c75ff4dd4a7a5ffeedf2f02d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// run-rustfix
fn id<T>(x: T) -> T { x }
fn main() {
let binding = id(3);
let v = vec![
&binding
];
//~^^ ERROR temporary value dropped while borrowed
for &&x in &v {
println!("{}", x + 3);
}
}
|