]> git.lizzy.rs Git - rust.git/blob - tests/target/hard-tabs.rs
more fallout
[rust.git] / tests / target / hard-tabs.rs
1 // rustfmt-normalize_comments: true
2 // rustfmt-single_line_if_else_max_width: 0
3 // rustfmt-wrap_comments: true
4 // rustfmt-hard_tabs: true
5
6 fn main() {
7         let x = Bar;
8
9         let y = Foo { a: x };
10
11         Foo {
12                 a: foo(), // comment
13                 // comment
14                 b: bar(),
15                 ..something
16         };
17
18         fn foo(a: i32,
19                a: i32,
20                a: i32,
21                a: i32,
22                a: i32,
23                a: i32,
24                a: i32,
25                a: i32,
26                a: i32,
27                a: i32,
28                a: i32) {
29         }
30
31         let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAa";
32
33         if let (some_very_large,
34                 tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3 {}
35
36         if cond() {
37                 something();
38         } else if different_cond() {
39                 something_else();
40         } else {
41                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
42                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
43         }
44
45         unsafe /* very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
46                 * comment */ {
47         }
48
49         unsafe /* So this is a very long comment.
50                 * Multi-line, too.
51                 * Will it still format correctly? */ {
52         }
53
54         let chain = funktion_kall()
55                 .go_to_next_line_with_tab()
56                 .go_to_next_line_with_tab()
57                 .go_to_next_line_with_tab();
58
59         let z =
60                 [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz, q];
61
62         fn generic<T>(arg: T) -> &SomeType
63                 where T: Fn(// First arg
64                             A,
65                             // Second argument
66                             B,
67                             C,
68                             D,
69                             // pre comment
70                             E /* last comment */)
71                             -> &SomeType
72         {
73                 arg(a, b, c, d, e)
74         }
75
76         loong_func().quux(move || if true {
77                                   1
78                                  } else {
79                                   2
80                                  });
81
82         fffffffffffffffffffffffffffffffffff(a, {
83                 SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
84         });
85         a.b
86                 .c
87                 .d();
88
89         x().y(|| match cond() {
90                   true => (),
91                   false => (),
92               });
93 }