rust/src/test/ui/issues/issue-17545.nll.stderr

18 lines
631 B
Plaintext
Raw Normal View History

2018-09-25 10:24:20 -05:00
error[E0716]: temporary value dropped while borrowed
2018-07-15 16:11:54 -05:00
--> $DIR/issue-17545.rs:17:10
|
LL | &id(()), //~ ERROR borrowed value does not live long enough
| ^^^^^^ creates a temporary which is freed while still in use
2018-07-15 16:11:54 -05:00
LL | ));
| - temporary value is freed at the end of this statement
2018-07-15 16:11:54 -05:00
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 15:12...
--> $DIR/issue-17545.rs:15:12
|
LL | pub fn foo<'a, F: Fn(&'a ())>(bar: F) {
| ^^
error: aborting due to previous error
2018-09-25 10:24:20 -05:00
For more information about this error, try `rustc --explain E0716`.