3 #![deny(print_stdout, use_debug)]
5 use std::fmt::{Debug, Display, Formatter, Result};
10 impl Display for Foo {
11 fn fmt(&self, f: &mut Formatter) -> Result {
12 write!(f, "{:?}", 43.1415)
13 //~^ ERROR use of `Debug`-based formatting
18 fn fmt(&self, f: &mut Formatter) -> Result {
19 // ok, we can use `Debug` formatting in `Debug` implementations
20 write!(f, "{:?}", 42.718)
25 println!("Hello"); //~ERROR use of `println!`
26 print!("Hello"); //~ERROR use of `print!`
28 print!("Hello {}", "World"); //~ERROR use of `print!`
30 print!("Hello {:?}", "World");
31 //~^ ERROR use of `print!`
32 //~| ERROR use of `Debug`-based formatting
34 print!("Hello {:#?}", "#orld");
35 //~^ ERROR use of `print!`
36 //~| ERROR use of `Debug`-based formatting