Closed
Description
openedon Jun 29, 2018
This code:
fn main() {
let test = &"hello".to_owned();
let args = format_args!("{}", test);
}
returns this error:
6 | let args = format_args!("{}", test);
| ^^^^ - temporary value dropped here while still borrowed
| |
| temporary value does not live long enough
7 | }
| - temporary value needs to live until here
|
= note: consider using a `let` binding to increase its lifetime
This makes no sense to me. Doesn't "{}"
have a static lifetime?
btw this is related to rust-lang/log#282, I'm trying to recreate a fmt::Arguments
to build a log::Record
. This with 1.27.0.
Thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels