2020-02-20 22:19:51 -06:00
|
|
|
use std::fmt::{Display, Error, Formatter};
|
|
|
|
|
|
|
|
// This test case exercises std::sys_common::remutex::ReentrantMutex
|
2020-04-05 12:09:31 -05:00
|
|
|
// by calling println!() from inside fmt.
|
2020-02-20 22:19:51 -06:00
|
|
|
|
2020-02-21 19:05:24 -06:00
|
|
|
struct InterruptingCow;
|
2020-02-20 22:19:51 -06:00
|
|
|
|
|
|
|
impl Display for InterruptingCow {
|
|
|
|
fn fmt(&self, _f: &mut Formatter<'_>) -> Result<(), Error> {
|
|
|
|
println!("Moo");
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-02-21 19:05:24 -06:00
|
|
|
println!("\"Knock knock\" \"Who's {} there?\"", InterruptingCow);
|
2020-02-20 22:19:51 -06:00
|
|
|
}
|