1 // Regression test for issue #27592.
3 fn write<'a, F: ::std::ops::FnOnce()->::std::fmt::Arguments<'a> + 'a>(fcn: F) {
5 let _ = match fcn() { a => write!(&mut Stream, "{}", a), };
9 impl ::std::fmt::Write for Stream {
10 fn write_str(&mut self, _s: &str) -> ::std::fmt::Result {
16 write(|| format_args!("{}", String::from("Hello world")));
17 //~^ ERROR borrowed value does not live long enough
18 //~| ERROR borrowed value does not live long enough