]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/issue-15480.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / span / issue-15480.rs
1 // run-rustfix
2 fn id<T>(x: T) -> T { x }
3
4 fn main() {
5     let v = vec![
6         &id(3)
7     ];
8     //~^^ ERROR temporary value dropped while borrowed
9
10     for &&x in &v {
11         println!("{}", x + 3);
12     }
13 }