3 use std::fmt::{self, Display};
8 fn lock(&self) -> MutexGuard {
13 struct MutexGuard<'a>(&'a Mutex);
15 impl<'a> Drop for MutexGuard<'a> {
17 // Empty but this is a necessary part of the repro. Otherwise borrow
18 // checker is fine with 'a dangling at the time that MutexGuard goes out
23 impl<'a> MutexGuard<'a> {
24 fn write_fmt(&self, _args: fmt::Arguments) {}
27 impl<'a> Display for MutexGuard<'a> {
28 fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
37 write!(out.lock(), "{}", mutex.lock()) /* no semicolon */
43 writeln!(out.lock(), "{}", mutex.lock()) /* no semicolon */
48 print!("{}", mutex.lock()) /* no semicolon */
53 println!("{}", mutex.lock()) /* no semicolon */
58 eprint!("{}", mutex.lock()) /* no semicolon */
63 eprintln!("{}", mutex.lock()) /* no semicolon */
68 panic!("{}", mutex.lock()) /* no semicolon */