|
| 1 | +error[E0716]: temporary value dropped while borrowed |
| 2 | + --> $DIR/bare-trait-object-borrowck.rs:23:48 |
| 3 | + | |
| 4 | +LL | let _ = new_format(0..32, " | ", |i, f| f(&format_args!("0x{:x}", i))); |
| 5 | + | - ---^^^^^^^^^^^^^^^^^^^^^^^^^- |
| 6 | + | | | | | |
| 7 | + | | | | temporary value is freed at the end of this statement |
| 8 | + | | | creates a temporary which is freed while still in use |
| 9 | + | | argument requires that borrow lasts for `'1` |
| 10 | + | has type `&mut dyn FnMut(&'1 (dyn std::fmt::Display + '1)) -> Result<(), std::fmt::Error>` |
| 11 | + | |
| 12 | + = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 13 | + |
| 14 | +error[E0716]: temporary value dropped while borrowed |
| 15 | + --> $DIR/bare-trait-object-borrowck.rs:23:48 |
| 16 | + | |
| 17 | +LL | let _ = new_format(0..32, " | ", |i, f| f(&format_args!("0x{:x}", i))); |
| 18 | + | - ---^^^^^^^^^^^^^^^^^^^^^^^^^- |
| 19 | + | | | | | |
| 20 | + | | | | temporary value is freed at the end of this statement |
| 21 | + | | | creates a temporary which is freed while still in use |
| 22 | + | | argument requires that borrow lasts for `'1` |
| 23 | + | has type `&mut dyn FnMut(&'1 (dyn std::fmt::Display + '1)) -> Result<(), std::fmt::Error>` |
| 24 | + | |
| 25 | + = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 26 | + |
| 27 | +error[E0597]: `i` does not live long enough |
| 28 | + --> $DIR/bare-trait-object-borrowck.rs:23:71 |
| 29 | + | |
| 30 | +LL | let _ = new_format(0..32, " | ", |i, f| f(&format_args!("0x{:x}", i))); |
| 31 | + | - --------------------------^-- |
| 32 | + | | | | | |
| 33 | + | | | | `i` dropped here while still borrowed |
| 34 | + | | | borrowed value does not live long enough |
| 35 | + | | argument requires that `i` is borrowed for `'1` |
| 36 | + | has type `&mut dyn FnMut(&'1 (dyn std::fmt::Display + '1)) -> Result<(), std::fmt::Error>` |
| 37 | + | |
| 38 | + = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 39 | + |
| 40 | +error: aborting due to 3 previous errors |
| 41 | + |
| 42 | +Some errors have detailed explanations: E0597, E0716. |
| 43 | +For more information about an error, try `rustc --explain E0597`. |
0 commit comments