You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The super operands of [`format_args!`] are [implicitly borrowed] and are therefore [place expression contexts]. When a [value expression] is passed as an argument, it creates a *super temporary*.
291
284
292
-
<!-- FIXME: Simplify after https://github.com/rust-lang/rust/pull/145882 lands. -->
293
285
```rust
294
286
# fntemp() ->String { String::from("") }
295
-
letx=format_args!("{}{}", temp(), temp());
296
-
x; // <-- The temporaries are extended, allowing use here.
287
+
letx=format_args!("{}", temp());
288
+
x; // <-- The temporary is extended, allowing use here.
297
289
```
298
290
299
291
The expansion of a call to [`format_args!`] sometimes creates other internal *super temporaries*.
0 commit comments