]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/pass/reentrant-println.rs
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[rust.git] / src / tools / miri / tests / pass / reentrant-println.rs
1 use std::fmt::{Display, Error, Formatter};
2
3 // This test case exercises std::sys_common::remutex::ReentrantMutex
4 // by calling println!() from inside fmt.
5
6 struct InterruptingCow;
7
8 impl Display for InterruptingCow {
9     fn fmt(&self, _f: &mut Formatter<'_>) -> Result<(), Error> {
10         println!("Moo");
11         Ok(())
12     }
13 }
14
15 fn main() {
16     println!("\"Knock knock\" \"Who's {} there?\"", InterruptingCow);
17 }