2022-07-14 17:12:01 -07:00
|
|
|
//@ run-rustfix
|
2017-08-13 11:46:49 +03:00
|
|
|
fn id<T>(x: T) -> T { x }
|
|
|
|
|
2014-12-07 15:22:06 +00:00
|
|
|
fn main() {
|
|
|
|
let v = vec![
|
2017-08-13 11:46:49 +03:00
|
|
|
&id(3)
|
2017-12-13 17:27:23 -08:00
|
|
|
];
|
2019-04-22 08:40:08 +01:00
|
|
|
//~^^ ERROR temporary value dropped while borrowed
|
2014-12-07 15:22:06 +00:00
|
|
|
|
2015-01-31 12:20:46 -05:00
|
|
|
for &&x in &v {
|
2014-12-07 15:22:06 +00:00
|
|
|
println!("{}", x + 3);
|
|
|
|
}
|
|
|
|
}
|