fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
938 B21 linesraw
1error[E0515]: cannot return value referencing temporary value
2  --> $DIR/issue-27592.rs:16:14
3   |
4LL |     write(|| format_args!("{}", String::from("Hello world")));
5   |              ^^^^^^^^^^^^^^^^^^^---------------------------^
6   |              |                  |
7   |              |                  temporary value created here
8   |              returns a value referencing data owned by the current function
9
10error[E0515]: cannot return value referencing temporary value
11  --> $DIR/issue-27592.rs:16:14
12   |
13LL |     write(|| format_args!("{}", String::from("Hello world")));
14   |              ^^^^^^^^^^^^^----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15   |              |            |
16   |              |            temporary value created here
17   |              returns a value referencing data owned by the current function
18
19error: aborting due to 2 previous errors
20
21For more information about this error, try `rustc --explain E0515`.