fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB33 linesraw
1error[E0716]: temporary value dropped while borrowed
2  --> $DIR/issue-114374-invalid-help-fmt-args.rs:5:13
3   |
4LL |     let x = format_args!("a {} {} {}.", 1, format_args!("b{}!", 2), 3);
5   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
6   |             |
7   |             creates a temporary value which is freed while still in use
8...
9LL |     bar(x);
10   |         - borrow later used here
11   |
12   = note: the result of `format_args!` can only be assigned directly if no placeholders in it's arguments are used
13   = note: to learn more, visit <https://doc.rust-lang.org/std/macro.format_args.html>
14   = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
15
16error[E0716]: temporary value dropped while borrowed
17  --> $DIR/issue-114374-invalid-help-fmt-args.rs:10:15
18   |
19LL |     let foo = format_args!("{}", "hi");
20   |               ^^^^^^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
21   |               |
22   |               creates a temporary value which is freed while still in use
23LL |
24LL |     bar(foo);
25   |         --- borrow later used here
26   |
27   = note: the result of `format_args!` can only be assigned directly if no placeholders in it's arguments are used
28   = note: to learn more, visit <https://doc.rust-lang.org/std/macro.format_args.html>
29   = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0716`.