blob: 4a6c2f9ed0653a0de6ccb63cd3a135cc3d5153a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#![allow(dead_code)]
fn bar<'a>(_: std::fmt::Arguments<'a>) {}
fn main() {
let x = format_args!("a {} {} {}.", 1, format_args!("b{}!", 2), 3);
//~^ ERROR temporary value dropped while borrowed
bar(x);
let foo = format_args!("{}", "hi");
//~^ ERROR temporary value dropped while borrowed
bar(foo);
let foo = format_args!("hi"); // no placeholder in arguments, so no error
bar(foo);
}
|