rust/tests/ui/span/issue-15480.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
209 B
Rust
Raw Normal View History

// 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
];
//~^^ 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);
}
}