Add known issue of let binding to format_args doc
This commit is contained in:
committed by
Antoine
parent
9d795a6e6e
commit
cd7c161294
@@ -868,6 +868,14 @@ pub(crate) mod builtin {
|
|||||||
/// let s = fmt::format(format_args!("hello {}", "world"));
|
/// let s = fmt::format(format_args!("hello {}", "world"));
|
||||||
/// assert_eq!(s, format!("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")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(test), rustc_diagnostic_item = "format_args_macro")]
|
#[cfg_attr(not(test), rustc_diagnostic_item = "format_args_macro")]
|
||||||
#[allow_internal_unsafe]
|
#[allow_internal_unsafe]
|
||||||
|
|||||||
Reference in New Issue
Block a user