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> Display for MutexGuard<'a> {
24 fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
32 print!("{}", mutex.lock()) /* no semicolon */
37 println!("{}", mutex.lock()) /* no semicolon */
42 eprint!("{}", mutex.lock()) /* no semicolon */
47 eprintln!("{}", mutex.lock()) /* no semicolon */
52 panic!("{}", mutex.lock()) /* no semicolon */