Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 59b4403

Browse files
authored
Unrolled build for rust-lang#111106
Rollup merge of rust-lang#111106 - Stargateur:doc/format_args, r=m-ou-se Add known issue of let binding to format_args doc Simply add doc about rust-lang#92698. `@rustbot` label +T-rustdoc -T-libs r? `@GuillaumeGomez`
2 parents bd6b336 + cd7c161 commit 59b4403

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/core/src/macros/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,14 @@ pub(crate) mod builtin {
969969
/// let s = fmt::format(format_args!("hello {}", "world"));
970970
/// assert_eq!(s, format!("hello {}", "world"));
971971
/// ```
972+
///
973+
/// # Lifetime limitation
974+
///
975+
/// Except when no formatting arguments are used,
976+
/// the produced `fmt::Arguments` value borrows temporary values,
977+
/// which means it can only be used within the same expression
978+
/// and cannot be stored for later use.
979+
/// This is a known limitation, see [#92698](https://github.com/rust-lang/rust/issues/92698).
972980
#[stable(feature = "rust1", since = "1.0.0")]
973981
#[cfg_attr(not(test), rustc_diagnostic_item = "format_args_macro")]
974982
#[allow_internal_unsafe]

0 commit comments

Comments
 (0)