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