File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -868,6 +868,14 @@ pub(crate) mod builtin {
868
868
/// let s = fmt::format(format_args!("hello {}", "world"));
869
869
/// assert_eq!(s, format!("hello {}", "world"));
870
870
/// ```
871
+ ///
872
+ /// # Lifetime limitation
873
+ ///
874
+ /// Except when no formatting arguments are used,
875
+ /// the produced `fmt::Arguments` value borrows temporary values,
876
+ /// which means it can only be used within the same expression
877
+ /// and cannot be stored for later use.
878
+ /// This is a known limitation, see [#92698](https://github.com/rust-lang/rust/issues/92698).
871
879
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
872
880
#[ cfg_attr( not( test) , rustc_diagnostic_item = "format_args_macro" ) ]
873
881
#[ allow_internal_unsafe]
You can’t perform that action at this time.
0 commit comments