You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnmain(){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.