]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-17545.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-17545.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/issue-17545.rs:7:10
3    |
4 LL |   pub fn foo<'a, F: Fn(&'a ())>(bar: F) {
5    |              -- lifetime `'a` defined here
6 LL | /     bar.call((
7 LL | |         &id(()),
8    | |          ^^^^^^ creates a temporary value which is freed while still in use
9 LL | |     ));
10    | |      -- temporary value is freed at the end of this statement
11    | |______|
12    |        argument requires that borrow lasts for `'a`
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0716`.