]> git.lizzy.rs Git - rust.git/blob - tests/source/skip.rs
Merge pull request #2028 from wada314/win-test-crlf
[rust.git] / tests / source / skip.rs
1 // Test the skip attribute works
2
3 #[rustfmt_skip]
4 fn foo() { badly; formatted; stuff
5 ; }
6
7 #[rustfmt_skip]
8 trait Foo
9 {
10 fn foo(
11 );
12 }
13
14 impl LateLintPass for UsedUnderscoreBinding {
15     #[cfg_attr(rustfmt, rustfmt_skip)]
16     fn check_expr() { // comment
17     }
18 }
19
20 fn issue1346() {
21     #[cfg_attr(rustfmt, rustfmt_skip)]
22     Box::new(self.inner.call(req).then(move |result| {
23         match result {
24             Ok(resp) => Box::new(future::done(Ok(resp))),
25             Err(e) => {
26                 try_error!(clo_stderr, "{}", e);
27                 Box::new(future::err(e))
28             }
29         }
30     }))
31 }
32
33 fn skip_on_statements() {
34     // Semi
35     #[cfg_attr(rustfmt, rustfmt_skip)]
36     foo(
37         1, 2, 3, 4,
38         1, 2,
39         1, 2, 3,
40     );
41
42     // Local
43     #[cfg_attr(rustfmt, rustfmt_skip)]
44     let x = foo(  a,   b  ,  c);
45
46     // Item
47     #[cfg_attr(rustfmt, rustfmt_skip)]
48     use   foobar  ;
49
50     // Mac
51     #[cfg_attr(rustfmt, rustfmt_skip)]
52     vec![
53         1, 2, 3, 4,
54         1, 2, 3, 4,
55         1, 2, 3, 4,
56         1, 2, 3,
57         1,
58         1, 2,
59         1,
60     ];
61
62     // Expr
63     #[cfg_attr(rustfmt, rustfmt_skip)]
64     foo(  a,   b  ,  c)
65 }