mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 02:54:00 +00:00
Format source codes and update tests
This commit is contained in:
parent
0a2567db93
commit
b78b6e8b09
@ -1686,7 +1686,8 @@ fn rewrite_match_body(
|
||||
) -> Option<String> {
|
||||
let (extend, body) = match body.node {
|
||||
ast::ExprKind::Block(ref block)
|
||||
if !is_unsafe_block(block) && is_simple_block(block, context.codemap) => {
|
||||
if !is_unsafe_block(block) && is_simple_block(block, context.codemap) =>
|
||||
{
|
||||
if let ast::StmtKind::Expr(ref expr) = block.stmts[0].node {
|
||||
(expr.can_be_overflowed(context, 1), &**expr)
|
||||
} else {
|
||||
|
@ -563,7 +563,10 @@ impl<'a> FmtVisitor<'a> {
|
||||
if s.rewrite(
|
||||
&self.get_context(),
|
||||
Shape::indented(self.block_indent, self.config),
|
||||
).is_none() => true,
|
||||
).is_none() =>
|
||||
{
|
||||
true
|
||||
}
|
||||
None => true,
|
||||
_ => self.failed,
|
||||
};
|
||||
|
@ -7,7 +7,10 @@ fn main() {
|
||||
match x
|
||||
{
|
||||
aaaaaaaa::Bbbbb::Ccccccccccccc(_, Some(ref x))
|
||||
if x == "aaaaaaaaaaa aaaaaaa aaaaaa" => Ok(()),
|
||||
if x == "aaaaaaaaaaa aaaaaaa aaaaaa" =>
|
||||
{
|
||||
Ok(())
|
||||
}
|
||||
_ => Err(x),
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,10 @@ fn foo() {
|
||||
}
|
||||
|
||||
Patternnnnnnnnnnnnnnnnnnnnnnnnn | Patternnnnnnnnnnnnnnnnnnnnnnnnn
|
||||
if looooooooooooooooooooooooooooooooooooooooong_guard => meh,
|
||||
if looooooooooooooooooooooooooooooooooooooooong_guard =>
|
||||
{
|
||||
meh
|
||||
}
|
||||
|
||||
// Test that earlier patterns can take the guard space
|
||||
(aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |
|
||||
|
Loading…
Reference in New Issue
Block a user