We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4356e83 commit 5fb947fCopy full SHA for 5fb947f
library/coretests/tests/fmt/mod.rs
@@ -12,6 +12,12 @@ fn test_lifetime() {
12
let a = format_args!("hello {a} {a:?}");
13
assert_eq!(a.to_string(), "hello hello hello hello hello hello hello");
14
15
+ // Check that temporaries as arguments are extended.
16
+ let b = format_args!("{}", String::new());
17
+ let c = format_args!("{}{}", String::new(), String::new());
18
+ assert_eq!(b.to_string(), "");
19
+ assert_eq!(c.to_string(), "");
20
+
21
// Without arguments, it should also work in consts.
22
const A: std::fmt::Arguments<'static> = format_args!("hello");
23
assert_eq!(A.to_string(), "hello");
0 commit comments