// run-passusestd::fmt;structFoo;implfmt::DebugforFoo{fnfmt(&self,fmt: &mutfmt::Formatter)-> fmt::Result{println!("<Foo as Debug>::fmt()");write!(fmt,"")}}fntest1(){letfoo_str=format!("{:?}",Foo);println!("{}",foo_str);}fntest2(){println!("{:?}",Foo);}fnmain(){// This works finetest1();// This failstest2();}