fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
817 B18 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 reference to temporary value
11  --> $DIR/issue-27592.rs:16:14
12   |
13LL |     write(|| format_args!("{}", String::from("Hello world")));
14   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function
15
16error: aborting due to 2 previous errors
17
18For more information about this error, try `rustc --explain E0515`.