]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-27592.stderr
Rollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compiler-errors
[rust.git] / tests / 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    = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
11
12 error[E0515]: cannot return reference to temporary value
13   --> $DIR/issue-27592.rs:16:14
14    |
15 LL |     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 the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
19
20 error: aborting due to 2 previous errors
21
22 For more information about this error, try `rustc --explain E0515`.