Skip to content

Commit 0238d26

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/core/src/macros/mod.rs

+8
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)