fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
636 B16 linesraw
1error: borrowed data cannot be stored outside of its closure
2  --> $DIR/issue-7573.rs:21:27
3   |
4LL |     let mut lines_to_use: Vec<&CrateId> = Vec::new();
5   |                               - cannot infer an appropriate lifetime...
6LL |
7LL |     let push_id = |installed_id: &CrateId| {
8   |         -------   ------------------------ borrowed data cannot outlive this closure
9   |         |
10   |         ...so that variable is valid at time of its declaration
11...
12LL |         lines_to_use.push(installed_id);
13   |                           ^^^^^^^^^^^^ cannot be stored outside of its closure
14
15error: aborting due to previous error
16