about summary refs log tree commit diff
path: root/library/core
diff options
context:
space:
mode:
authorAntoine PLASKOWSKI <plaskowski.stanislas@gmail.com>2023-05-02 20:36:48 +0200
committerAntoine <plaskowski.stanislas@gmail.com>2023-06-21 16:51:39 +0200
commitcd7c161294eac4c2cce5c503f1c5b05ce24864a7 (patch)
tree6e17fce3e5db5d81c505bf0ef1d27cbabda62b76 /library/core
parent9d795a6e6e19d56b235d1dbd4f5941404cf5918c (diff)
downloadrust-cd7c161294eac4c2cce5c503f1c5b05ce24864a7.tar.gz
rust-cd7c161294eac4c2cce5c503f1c5b05ce24864a7.zip
Add known issue of let binding to format_args doc
Diffstat (limited to 'library/core')
-rw-r--r--library/core/src/macros/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs
index 7c93c93b4a0..a9818371f9e 100644
--- a/library/core/src/macros/mod.rs
+++ b/library/core/src/macros/mod.rs
@@ -868,6 +868,14 @@ pub(crate) mod builtin {
     /// let s = fmt::format(format_args!("hello {}", "world"));
     /// assert_eq!(s, format!("hello {}", "world"));
     /// ```
+    ///
+    /// # Lifetime limitation
+    ///
+    /// Except when no formatting arguments are used,
+    /// the produced `fmt::Arguments` value borrows temporary values,
+    /// which means it can only be used within the same expression
+    /// and cannot be stored for later use.
+    /// This is a known limitation, see [#92698](https://github.com/rust-lang/rust/issues/92698).
     #[stable(feature = "rust1", since = "1.0.0")]
     #[cfg_attr(not(test), rustc_diagnostic_item = "format_args_macro")]
     #[allow_internal_unsafe]