2017-01-15 19:50:27 -06:00
|
|
|
// rustfmt-normalize_comments: true
|
2016-05-29 10:58:38 -05:00
|
|
|
// rustfmt-single_line_if_else_max_width: 0
|
2015-11-09 13:03:01 -06:00
|
|
|
// rustfmt-wrap_comments: true
|
2015-09-19 02:00:53 -05:00
|
|
|
// rustfmt-hard_tabs: true
|
2017-02-19 12:57:02 -06:00
|
|
|
// rustfmt-error_on_line_overflow: false
|
2015-09-19 02:00:53 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Bar;
|
|
|
|
|
|
|
|
let y = Foo { a: x };
|
|
|
|
|
|
|
|
Foo {
|
|
|
|
a: foo(), // comment
|
|
|
|
// comment
|
|
|
|
b: bar(),
|
|
|
|
..something
|
|
|
|
};
|
|
|
|
|
2017-05-25 08:55:33 -05:00
|
|
|
fn foo(a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32, a: i32) {
|
2015-09-19 02:00:53 -05:00
|
|
|
}
|
|
|
|
|
2016-04-11 13:45:47 -05:00
|
|
|
let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAa";
|
2015-09-19 02:00:53 -05:00
|
|
|
|
2015-10-17 08:56:53 -05:00
|
|
|
if let (some_very_large,
|
2017-01-15 21:37:58 -06:00
|
|
|
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3 {}
|
2015-09-19 02:00:53 -05:00
|
|
|
|
|
|
|
if cond() {
|
|
|
|
something();
|
|
|
|
} else if different_cond() {
|
|
|
|
something_else();
|
|
|
|
} else {
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe /* very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
|
|
|
|
* comment */ {
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe /* So this is a very long comment.
|
|
|
|
* Multi-line, too.
|
|
|
|
* Will it still format correctly? */ {
|
|
|
|
}
|
|
|
|
|
2015-10-14 12:41:29 -05:00
|
|
|
let chain = funktion_kall()
|
2016-04-22 01:53:39 -05:00
|
|
|
.go_to_next_line_with_tab()
|
|
|
|
.go_to_next_line_with_tab()
|
|
|
|
.go_to_next_line_with_tab();
|
2015-10-14 12:41:29 -05:00
|
|
|
|
2017-04-05 20:06:11 -05:00
|
|
|
let z = [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
|
|
|
|
yyyyyyyyyyyyyyyyyyyyyyyyyyy,
|
|
|
|
zzzzzzzzzzzzzzzzzz,
|
|
|
|
q];
|
2015-09-19 02:00:53 -05:00
|
|
|
|
|
|
|
fn generic<T>(arg: T) -> &SomeType
|
|
|
|
where T: Fn(// First arg
|
|
|
|
A,
|
|
|
|
// Second argument
|
|
|
|
B,
|
|
|
|
C,
|
|
|
|
D,
|
|
|
|
// pre comment
|
2015-11-22 07:48:30 -06:00
|
|
|
E /* last comment */)
|
|
|
|
-> &SomeType
|
2015-09-19 02:00:53 -05:00
|
|
|
{
|
|
|
|
arg(a, b, c, d, e)
|
|
|
|
}
|
|
|
|
|
2016-11-20 13:37:35 -06:00
|
|
|
loong_func().quux(move || if true {
|
2017-02-22 13:52:52 -06:00
|
|
|
1
|
|
|
|
} else {
|
|
|
|
2
|
|
|
|
});
|
2015-09-19 02:00:53 -05:00
|
|
|
|
2015-10-08 16:07:19 -05:00
|
|
|
fffffffffffffffffffffffffffffffffff(a, {
|
2016-11-20 13:37:35 -06:00
|
|
|
SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
|
2015-10-08 16:07:19 -05:00
|
|
|
});
|
2017-03-06 16:28:25 -06:00
|
|
|
a.b.c.d();
|
2015-09-19 02:00:53 -05:00
|
|
|
|
2016-11-20 13:37:35 -06:00
|
|
|
x().y(|| match cond() {
|
2017-02-22 13:52:52 -06:00
|
|
|
true => (),
|
|
|
|
false => (),
|
|
|
|
});
|
2015-09-19 02:00:53 -05:00
|
|
|
}
|