1 error[E0515]: cannot return value referencing temporary value
2 --> $DIR/issue-27592.rs:16:14
4 LL | write(|| format_args!("{}", String::from("Hello world")));
5 | ^^^^^^^^^^^^^^^^^^^---------------------------^
7 | | temporary value created here
8 | returns a value referencing data owned by the current function
10 = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
12 error[E0515]: cannot return reference to temporary value
13 --> $DIR/issue-27592.rs:16:14
15 LL | write(|| format_args!("{}", String::from("Hello world")));
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function
18 = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
20 error: aborting due to 2 previous errors
22 For more information about this error, try `rustc --explain E0515`.