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