]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-7573.stderr
32b3ef72d8bda611f94bed13e278400efc920a91
[rust.git] / src / test / ui / borrowck / issue-7573.stderr
1 error: borrowed data cannot be stored outside of its closure
2   --> $DIR/issue-7573.rs:21:27
3    |
4 LL |     let mut lines_to_use: Vec<&CrateId> = Vec::new();
5    |                               - cannot infer an appropriate lifetime...
6 LL |
7 LL |     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 ...
12 LL |         lines_to_use.push(installed_id);
13    |                           ^^^^^^^^^^^^ cannot be stored outside of its closure
14
15 error: aborting due to previous error
16