]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-27592.stderr
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-27592.stderr
1 error[E0515]: cannot return value referencing temporary value
2   --> $DIR/issue-27592.rs:16:14
3    |
4 LL |     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 error[E0515]: cannot return value referencing temporary value
11   --> $DIR/issue-27592.rs:16:14
12    |
13 LL |     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
19 error: aborting due to 2 previous errors
20
21 For more information about this error, try `rustc --explain E0515`.