rust/tests/target/hard-tabs.rs

97 lines
1.8 KiB
Rust
Raw Normal View History

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