]> git.lizzy.rs Git - rust.git/blob - tests/ui/print.rs
remove all //~ from tests
[rust.git] / tests / ui / print.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3 #![deny(print_stdout, use_debug)]
4
5 use std::fmt::{Debug, Display, Formatter, Result};
6
7 #[allow(dead_code)]
8 struct Foo;
9
10 impl Display for Foo {
11     fn fmt(&self, f: &mut Formatter) -> Result {
12         write!(f, "{:?}", 43.1415)
13
14     }
15 }
16
17 impl Debug for Foo {
18     fn fmt(&self, f: &mut Formatter) -> Result {
19         // ok, we can use `Debug` formatting in `Debug` implementations
20         write!(f, "{:?}", 42.718)
21     }
22 }
23
24 fn main() {
25     println!("Hello");
26     print!("Hello");
27
28     print!("Hello {}", "World");
29
30     print!("Hello {:?}", "World");
31
32
33
34     print!("Hello {:#?}", "#orld");
35
36
37
38     assert_eq!(42, 1337);
39
40     vec![1, 2];
41 }