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