|
| 1 | +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants |
| 2 | + --> $DIR/format_args.rs:5:32 |
| 3 | + | |
| 4 | +LL | const B: std::fmt::Arguments = format_args!("{}", 123); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 8 | + |
| 9 | +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants |
| 10 | + --> $DIR/format_args.rs:5:32 |
| 11 | + | |
| 12 | +LL | const B: std::fmt::Arguments = format_args!("{}", 123); |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 14 | + | |
| 15 | + = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 16 | + |
| 17 | +error[E0716]: temporary value dropped while borrowed |
| 18 | + --> $DIR/format_args.rs:5:32 |
| 19 | + | |
| 20 | +LL | const B: std::fmt::Arguments = format_args!("{}", 123); |
| 21 | + | ^^^^^^^^^^^^^^^^^^^^^^- |
| 22 | + | | | |
| 23 | + | | temporary value is freed at the end of this statement |
| 24 | + | creates a temporary which is freed while still in use |
| 25 | + | using this value as a constant requires that borrow lasts for `'static` |
| 26 | + | |
| 27 | + = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 28 | + |
| 29 | +error: aborting due to 3 previous errors |
| 30 | + |
| 31 | +Some errors have detailed explanations: E0015, E0716. |
| 32 | +For more information about an error, try `rustc --explain E0015`. |
0 commit comments