fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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