]> git.lizzy.rs Git - rust.git/commitdiff
more fallout
authorNick Cameron <ncameron@mozilla.com>
Wed, 22 Feb 2017 19:52:52 +0000 (08:52 +1300)
committerNick Cameron <ncameron@mozilla.com>
Thu, 23 Feb 2017 00:15:48 +0000 (13:15 +1300)
27 files changed:
build.rs
src/bin/rustfmt.rs
src/chains.rs
src/expr.rs
src/file_lines.rs
src/imports.rs
src/items.rs
src/types.rs
tests/config/small_tabs.toml
tests/source/chains-block-indented-base.rs [deleted file]
tests/source/chains-no-overflow.rs [deleted file]
tests/source/chains-visual.rs
tests/system.rs
tests/target/chains-block-indented-base.rs [deleted file]
tests/target/chains-no-overflow.rs [deleted file]
tests/target/chains-no-overlow-2.rs [deleted file]
tests/target/chains-visual.rs
tests/target/chains.rs
tests/target/closure.rs
tests/target/comment.rs
tests/target/hard-tabs.rs
tests/target/issue-510.rs
tests/target/long-match-arms-brace-newline.rs
tests/target/long_field_access.rs
tests/target/match.rs
tests/target/struct_lits.rs
tests/target/struct_lits_multiline.rs

index 207d48eeb66b5c6d04331642e39e3482e6631400..4f4a63be4365d925d53e4effe3e0d9ead897324c 100644 (file)
--- a/build.rs
+++ b/build.rs
@@ -39,10 +39,10 @@ fn git_head_sha1() -> Option<String> {
         .ok()
         .and_then(|o| String::from_utf8(o.stdout).ok())
         .map(|mut s| {
-            let len = s.trim_right().len();
-            s.truncate(len);
-            s
-        })
+                 let len = s.trim_right().len();
+                 s.truncate(len);
+                 s
+             })
 }
 
 // Returns `None` if git is not available.
index de12252df0e418665144267279f1094880a6dd46..52d1a8f9f15c9d505d721106102c043e1640abc7 100644 (file)
@@ -335,11 +335,11 @@ fn determine_operation(matches: &Matches) -> FmtResult<Operation> {
     let config_path: Option<PathBuf> = matches.opt_str("config-path")
         .map(PathBuf::from)
         .and_then(|dir| {
-            if dir.is_file() {
-                return dir.parent().map(|v| v.into());
-            }
-            Some(dir)
-        });
+                      if dir.is_file() {
+                          return dir.parent().map(|v| v.into());
+                      }
+                      Some(dir)
+                  });
 
     // if no file argument is supplied and `--file-lines` is not specified, read from stdin
     if matches.free.is_empty() && !matches.opt_present("file-lines") {
index 218702cdbfd7521048e00c4082fd37d37cbc5d92..e9bd220158f66b41b5d6d2d54298d9de3951ad85 100644 (file)
@@ -133,9 +133,15 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
     let other_child_shape = Shape { width: max_width, ..nested_shape };
     let first_child_shape = if extend {
         let mut shape = try_opt!(parent_shape.shrink_left(last_line_width(&parent_rewrite)));
-        shape.offset = shape.offset.checked_sub(context.config.tab_spaces).unwrap_or(0);
-        shape.indent.block_indent += context.config.tab_spaces;
-        shape
+        match context.config.chain_indent {
+            BlockIndentStyle::Visual => other_child_shape,
+            BlockIndentStyle::Inherit => shape,
+            BlockIndentStyle::Tabbed => {
+                shape.offset = shape.offset.checked_sub(context.config.tab_spaces).unwrap_or(0);
+                shape.indent.block_indent += context.config.tab_spaces;
+                shape
+            }
+        }
     } else {
         other_child_shape
     };
@@ -286,7 +292,7 @@ fn make_subexpr_list(expr: &ast::Expr, context: &RewriteContext) -> (ast::Expr,
 
 fn chain_indent(context: &RewriteContext, shape: Shape) -> Shape {
     match context.config.chain_indent {
-        BlockIndentStyle::Visual => shape,
+        BlockIndentStyle::Visual => shape.visual_indent(0),
         BlockIndentStyle::Inherit => shape.block_indent(0),
         BlockIndentStyle::Tabbed => shape.block_indent(context.config.tab_spaces),
     }
index d54a724b5e99716c6b36eaeb25c7253d0d92203e..d4c34a054b34c868a14dd57ccf45f395f46d5847 100644 (file)
@@ -476,7 +476,6 @@ fn rewrite_closure(capture: ast::CaptureBy,
         }
 
         // Either we require a block, or tried without and failed.
-        let body_shape = shape.block();
         return rewrite_closure_block(&block, prefix, context, body_shape);
     }
 
@@ -1409,9 +1408,10 @@ fn rewrite_pat_expr(context: &RewriteContext,
 
         if let Some(expr_string) = expr_rewrite {
             let pat_simple = pat.and_then(|p| {
-                    p.rewrite(context,
-                              Shape::legacy(context.config.max_width, Indent::empty()))
-                })
+                                              p.rewrite(context,
+                                                        Shape::legacy(context.config.max_width,
+                                                                      Indent::empty()))
+                                          })
                 .map(|s| pat_is_simple(&s));
 
             if pat.is_none() || pat_simple.unwrap_or(false) || !expr_string.contains('\n') {
@@ -1548,8 +1548,9 @@ fn rewrite_call_inner<R>(context: &RewriteContext,
                              |item| item.span.lo,
                              |item| item.span.hi,
                              |item| {
-        item.rewrite(context, Shape { width: remaining_width, ..nested_shape })
-    },
+                                 item.rewrite(context,
+                                              Shape { width: remaining_width, ..nested_shape })
+                             },
                              span.lo,
                              span.hi);
     let mut item_vec: Vec<_> = items.collect();
@@ -1897,9 +1898,9 @@ pub fn rewrite_unary_suffix<R: Rewrite>(context: &RewriteContext,
                                         -> Option<String> {
     rewrite.rewrite(context, try_opt!(shape.sub_width(suffix.len())))
         .map(|mut r| {
-            r.push_str(suffix);
-            r
-        })
+                 r.push_str(suffix);
+                 r
+             })
 }
 
 fn rewrite_unary_op(context: &RewriteContext,
index 2bf54556d27d4eaf6626db491600ded7c919f485..145713ee1ec8bbaa930e1666ddb1f823c6d6d2ff 100644 (file)
@@ -121,8 +121,9 @@ pub fn contains(&self, range: &LineRange) -> bool {
         };
 
         match canonicalize_path_string(range.file_name()).and_then(|canonical| {
-            map.get_vec(&canonical).ok_or(())
-        }) {
+                                                                       map.get_vec(&canonical)
+                                                                           .ok_or(())
+                                                                   }) {
             Ok(ranges) => ranges.iter().any(|r| r.contains(Range::from(range))),
             Err(_) => false,
         }
index a2cfa34f1abc485f964adfd927bb74056f73e19d..0b432d072afee8e64c21ad0ff06e52b0a88f2934 100644 (file)
@@ -183,10 +183,10 @@ pub fn format_imports(&mut self, use_items: &[ptr::P<ast::Item>]) {
         let mut last_pos_of_prev_use_item = pos_before_first_use_item;
         let mut ordered_use_items = use_items.iter()
             .map(|p_i| {
-                let new_item = (&*p_i, last_pos_of_prev_use_item);
-                last_pos_of_prev_use_item = p_i.span.hi;
-                new_item
-            })
+                     let new_item = (&*p_i, last_pos_of_prev_use_item);
+                     last_pos_of_prev_use_item = p_i.span.hi;
+                     new_item
+                 })
             .collect::<Vec<_>>();
         let pos_after_last_use_item = last_pos_of_prev_use_item;
         // Order the imports by view-path & other import path properties
index d0b2c1ee45f57905824fb7a0999a21cd4e4ce25c..4e5dc9d576504b4b81de9539ced28578c3b35964 100644 (file)
@@ -1668,11 +1668,12 @@ fn rewrite_args(context: &RewriteContext,
                 span: Span,
                 variadic: bool)
                 -> Option<String> {
-    let mut arg_item_strs = try_opt!(args.iter()
-                                         .map(|arg| {
-        arg.rewrite(&context, Shape::legacy(multi_line_budget, arg_indent))
-    })
-                                         .collect::<Option<Vec<_>>>());
+    let mut arg_item_strs =
+        try_opt!(args.iter()
+                     .map(|arg| {
+                              arg.rewrite(&context, Shape::legacy(multi_line_budget, arg_indent))
+                          })
+                     .collect::<Option<Vec<_>>>());
 
     // Account for sugary self.
     // FIXME: the comment for the self argument is dropped. This is blocked
index 574def6d7c47331d17d118e311886f9fe1149acf..5fbf4a7e15051a6b9efd233921f3945b57d73fe4 100644 (file)
@@ -675,9 +675,9 @@ fn rewrite_bare_fn(bare_fn: &ast::BareFnTy,
         result.push_str(&try_opt!(bare_fn.lifetimes
                                       .iter()
                                       .map(|l| {
-            l.rewrite(context,
+                                               l.rewrite(context,
                       Shape::legacy(try_opt!(shape.width.checked_sub(6)), shape.indent + 4))
-        })
+                                           })
                                       .intersperse(Some(", ".to_string()))
                                       .collect::<Option<String>>()));
         result.push_str("> ");
index 2a0af63eea558cc95910957317a22438cb92245e..820978b8c32e286669d2aaf7ac1525315942af05 100644 (file)
@@ -23,5 +23,4 @@ report_fixme = "Never"
 reorder_imports = false
 single_line_if_else_max_width = 0
 format_strings = true
-chains_overflow_last = true
 take_source_hints = true
diff --git a/tests/source/chains-block-indented-base.rs b/tests/source/chains-block-indented-base.rs
deleted file mode 100644 (file)
index 6646056..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// rustfmt-single_line_if_else_max_width: 0
-// rustfmt-chain_base_indent: Inherit
-// Test chain formatting with block indented base
-
-fn floaters() {
-    let x = Foo {
-                field1: val1,
-                field2: val2,
-            }
-            .method_call().method_call();
-
-    let y = if cond {
-                val1
-            } else {
-                val2
-            }
-                .method_call();
-
-    {
-        match x {
-            PushParam => {
-                // params are 1-indexed
-                stack.push(mparams[match cur.to_digit(10) {
-                                            Some(d) => d as usize - 1,
-                                            None => return Err("bad param number".to_owned()),
-                                        }]
-                               .clone());
-            }
-        }
-    }
-}
diff --git a/tests/source/chains-no-overflow.rs b/tests/source/chains-no-overflow.rs
deleted file mode 100644 (file)
index 29c092d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// rustfmt-single_line_if_else_max_width: 0
-// rustfmt-chains_overflow_last: false
-// Test chain formatting without overflowing the last item.
-
-fn main() {
-    bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
-                       .ddddddddddddddddddddddddddd();
-
-    bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd.eeeeeeee();
-
-    x()
-        .y(|| match cond() { true => (), false => () });
-
-    loong_func()
-        .quux(move || if true {
-            1
-        } else {
-            2
-        });
-
-    fffffffffffffffffffffffffffffffffff(a,
-                                        {
-                                            SCRIPT_TASK_ROOT
-                                            .with(|root| {
-                                                        *root.borrow_mut()  =   Some(&script_task);
-                                                    });
-                                        });                                        
-
-    let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx
-        .map(|x| x + 5)
-        .map(|x| x / 2)
-        .fold(0, |acc, x| acc + x);
-
-    aaaaaaaaaaaaaaaa.map(|x| {
-                         x += 1;
-                         x
-                     }).filter(some_mod::some_filter)
-}
index ea7eeb605244a57e4c4c14c789b7c68653e05477..f0be8acdce97efb92d7ac5676a671a9ed0dc9d32 100644 (file)
@@ -1,7 +1,6 @@
 // rustfmt-normalize_comments: true
 // rustfmt-single_line_if_else_max_width: 0
 // rustfmt-chain_indent: Visual
-// rustfmt-chain_base_indent: Visual
 // Test chain formatting.
 
 fn main() {
index a0a8eefa27728b78e3e9e166aac9fdfa1164805a..7ce7c55181f1fdda3573edcc974a1bea0a135511 100644 (file)
@@ -295,11 +295,11 @@ fn read_significant_comments(file_name: &str) -> HashMap<String, String> {
         .map(|line| line.expect("Failed getting line"))
         .take_while(|line| line_regex.is_match(&line))
         .filter_map(|line| {
-            regex.captures_iter(&line).next().map(|capture| {
+                        regex.captures_iter(&line).next().map(|capture| {
                 (capture.at(1).expect("Couldn't unwrap capture").to_owned(),
                  capture.at(2).expect("Couldn't unwrap capture").to_owned())
             })
-        })
+                    })
         .collect()
 }
 
diff --git a/tests/target/chains-block-indented-base.rs b/tests/target/chains-block-indented-base.rs
deleted file mode 100644 (file)
index f737745..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// rustfmt-single_line_if_else_max_width: 0
-// rustfmt-chain_base_indent: Inherit
-// Test chain formatting with block indented base
-
-fn floaters() {
-    let x = Foo {
-        field1: val1,
-        field2: val2,
-    }
-    .method_call()
-    .method_call();
-
-    let y = if cond {
-        val1
-    } else {
-        val2
-    }
-    .method_call();
-
-    {
-        match x {
-            PushParam => {
-                // params are 1-indexed
-                stack.push(mparams[match cur.to_digit(10) {
-                    Some(d) => d as usize - 1,
-                    None => return Err("bad param number".to_owned()),
-                }]
-                .clone());
-            }
-        }
-    }
-}
diff --git a/tests/target/chains-no-overflow.rs b/tests/target/chains-no-overflow.rs
deleted file mode 100644 (file)
index a6fd0f9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// rustfmt-single_line_if_else_max_width: 0
-// rustfmt-chains_overflow_last: false
-// Test chain formatting without overflowing the last item.
-
-fn main() {
-    bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
-        .ddddddddddddddddddddddddddd();
-
-    bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
-        .ddddddddddddddddddddddddddd
-        .eeeeeeee();
-
-    x().y(|| match cond() {
-            true => (),
-            false => (),
-        });
-
-    loong_func()
-        .quux(move || if true {
-            1
-        } else {
-            2
-        });
-
-    fffffffffffffffffffffffffffffffffff(a,
-                                        {
-                                            SCRIPT_TASK_ROOT.with(|root| {
-                                                    *root.borrow_mut() = Some(&script_task);
-                                                });
-                                        });
-
-    let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx.map(|x| x + 5)
-        .map(|x| x / 2)
-        .fold(0, |acc, x| acc + x);
-
-    aaaaaaaaaaaaaaaa.map(|x| {
-            x += 1;
-            x
-        })
-        .filter(some_mod::some_filter)
-}
diff --git a/tests/target/chains-no-overlow-2.rs b/tests/target/chains-no-overlow-2.rs
deleted file mode 100644 (file)
index c110709..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-chains_overflow_last: false
-
-fn main() {
-    reader.lines()
-        .map(|line| line.expect("Failed getting line"))
-        .take_while(|line| line_regex.is_match(&line))
-        .filter_map(|line| {
-            regex.captures_iter(&line)
-                .next()
-                .map(|capture| {
-                    (capture.at(1).expect("Couldn\'t unwrap capture").to_owned(),
-                     capture.at(2).expect("Couldn\'t unwrap capture").to_owned())
-                })
-        })
-        .collect();
-}
index aff6f17052992eda4e1f2c2ba9361f8e4e35f456..e88c08fb93269ec4ac86e23d382e71215882d14a 100644 (file)
@@ -1,7 +1,6 @@
 // rustfmt-normalize_comments: true
 // rustfmt-single_line_if_else_max_width: 0
 // rustfmt-chain_indent: Visual
-// rustfmt-chain_base_indent: Visual
 // Test chain formatting.
 
 fn main() {
@@ -21,15 +20,15 @@ fn main() {
     // Test case where first chain element isn't a path, but is shorter than
     // the size of a tab.
     x().y(|| match cond() {
-        true => (),
-        false => (),
-    });
+              true => (),
+              false => (),
+          });
 
     loong_func().quux(move || if true {
-        1
-    } else {
-        2
-    });
+                          1
+                      } else {
+                          2
+                      });
 
     some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
         let x = c;
@@ -50,15 +49,15 @@ fn main() {
         SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
     });
 
-    let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx.map(|x| x + 5)
-                                                                          .map(|x| x / 2)
-                                                                          .fold(0,
-                                                                                |acc, x| acc + x);
+    let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
+        xxxxxxx.map(|x| x + 5)
+               .map(|x| x / 2)
+               .fold(0, |acc, x| acc + x);
 
     aaaaaaaaaaaaaaaa.map(|x| {
-                        x += 1;
-                        x
-                    })
+                             x += 1;
+                             x
+                         })
                     .filter(some_mod::some_filter)
 }
 
@@ -105,9 +104,9 @@ fn floaters() {
 
     Foo { x: val }
         .baz(|| {
-            force();
-            multiline();
-        })
+                 force();
+                 multiline();
+             })
         .quux();
 
     Foo {
@@ -115,9 +114,9 @@ fn floaters() {
         z: ok,
     }
     .baz(|| {
-        force();
-        multiline();
-    })
+             force();
+             multiline();
+         })
     .quux();
 
     a +
index d9e7d3a58fea10f1a02554b6d484eaf797e89640..c7fdd3076e4e38612d3d8d80385c689f155d4f88 100644 (file)
@@ -19,15 +19,15 @@ fn main() {
     // Test case where first chain element isn't a path, but is shorter than
     // the size of a tab.
     x().y(|| match cond() {
-        true => (),
-        false => (),
-    });
+              true => (),
+              false => (),
+          });
 
     loong_func().quux(move || if true {
-        1
-    } else {
-        2
-    });
+                          1
+                      } else {
+                          2
+                      });
 
     some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
         let x = c;
@@ -53,9 +53,9 @@ fn main() {
         .fold(0, |acc, x| acc + x);
 
     aaaaaaaaaaaaaaaa.map(|x| {
-            x += 1;
-            x
-        })
+                             x += 1;
+                             x
+                         })
         .filter(some_mod::some_filter)
 }
 
@@ -84,10 +84,10 @@ fn floaters() {
             PushParam => {
                 // params are 1-indexed
                 stack.push(mparams[match cur.to_digit(10) {
-                        Some(d) => d as usize - 1,
-                        None => return Err("bad param number".to_owned()),
-                    }]
-                    .clone());
+                                   Some(d) => d as usize - 1,
+                                   None => return Err("bad param number".to_owned()),
+                               }]
+                               .clone());
             }
         }
     }
@@ -102,9 +102,9 @@ fn floaters() {
 
     Foo { x: val }
         .baz(|| {
-            force();
-            multiline();
-        })
+                 force();
+                 multiline();
+             })
         .quux();
 
     Foo {
@@ -112,9 +112,9 @@ fn floaters() {
             z: ok,
         }
         .baz(|| {
-            force();
-            multiline();
-        })
+                 force();
+                 multiline();
+             })
         .quux();
 
     a +
@@ -173,7 +173,7 @@ fn issue_1004() {
     }?;
 
     ty::tls::with(|tcx| {
-        let tap = ty::Binder(TraitAndProjections(principal, projections));
-        in_binder(f, tcx, &ty::Binder(""), Some(tap))
-    })?;
+                      let tap = ty::Binder(TraitAndProjections(principal, projections));
+                      in_binder(f, tcx, &ty::Binder(""), Some(tap))
+                  })?;
 }
index bc4d03981d558291c1322b558a5fdbc5ede19ec7..a3d9cfe863bcfb494229a9a92e54b1c916bc7aa9 100644 (file)
@@ -74,16 +74,16 @@ fn issue863() {
 
 fn issue934() {
     let hash: &Fn(&&Block) -> u64 = &|block| -> u64 {
-        let mut h = SpanlessHash::new(cx);
-        h.hash_block(block);
-        h.finish()
-    };
+                                         let mut h = SpanlessHash::new(cx);
+                                         h.hash_block(block);
+                                         h.finish()
+                                     };
 
     let hash: &Fn(&&Block) -> u64 = &|block| -> u64 {
-        let mut h = SpanlessHash::new(cx);
-        h.hash_block(block);
-        h.finish();
-    };
+                                         let mut h = SpanlessHash::new(cx);
+                                         h.hash_block(block);
+                                         h.finish();
+                                     };
 }
 
 impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
index 9de4366b1c495c0e3f679dda633e9a044038d02d..3a9735139873ff53658cad381990486829a2d1a4 100644 (file)
@@ -41,10 +41,10 @@ fn doc_comment() {}
 
 fn chains() {
     foo.bar(|| {
-        let x = 10;
-        // comment
-        x
-    })
+                let x = 10;
+                // comment
+                x
+            })
 }
 
 fn issue_1086() {
index 43b00774a22fff05306621dd44091114001405d6..db8c95ed951d17309dd6fff92eea13231c021f74 100644 (file)
@@ -74,10 +74,10 @@ fn generic<T>(arg: T) -> &SomeType
        }
 
        loong_func().quux(move || if true {
-               1
-       } else {
-               2
-       });
+                                 1
+                                } else {
+                                 2
+                                });
 
        fffffffffffffffffffffffffffffffffff(a, {
                SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
@@ -87,7 +87,7 @@ fn generic<T>(arg: T) -> &SomeType
                .d();
 
        x().y(|| match cond() {
-               true => (),
-               false => (),
-       });
+                 true => (),
+                 false => (),
+             });
 }
index 5b5860998fa46508680577650a53b766aca6eb0c..21dca794e9339b988427acf0042668a34ba86352 100644 (file)
@@ -14,9 +14,9 @@ fn solve_inline_size_constraints(&self,
                     // and inline-size Auto.
                     //
                     // Set inline-end to zero to calculate inline-size.
-                    let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
-                                                                          (margin_start +
-                                                                           margin_end));
+                    let inline_size =
+                        block.get_shrink_to_fit_inline_size(available_inline_size -
+                                                            (margin_start + margin_end));
                     (Au(0), inline_size, margin_start, margin_end)
                 }
             };
@@ -30,9 +30,9 @@ fn solve_inline_size_constraints(&self,
                     // and inline-size Auto.
                     //
                     // Set inline-end to zero to calculate inline-size.
-                    let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
-                                                                          (margin_start +
-                                                                           margin_end));
+                    let inline_size =
+                        block.get_shrink_to_fit_inline_size(available_inline_size -
+                                                            (margin_start + margin_end));
                     (Au(0), inline_size, margin_start, margin_end)
                 }
             };
index 7cf094906cccdcadf00b0a1db4725553362df6bb..852fd4f2f147847628ee47a2eb16b02bffdbc783 100644 (file)
@@ -7,10 +7,7 @@ fn main() {
     {
         aaaaaaaa::Bbbbb::Ccccccccccccc(_, Some(ref x)) if x ==
                                                           "aaaaaaaaaaa \
-                                                           aaaaaaa aaaaaa" =>
-        {
-            Ok(())
-        }
+                                                           aaaaaaa aaaaaa" => Ok(()),
         _ => Err(x),
     }
 }
index e4efd86b7f9e62c2771cf3534a4710af4cdd7ba6..349d2c2f639ba3d9dfed1e0fea17f635939924d8 100644 (file)
@@ -1,4 +1,4 @@
 fn f() {
-    block_flow.base.stacking_relative_position_of_display_port = self.base
-        .stacking_relative_position_of_display_port;
+    block_flow.base.stacking_relative_position_of_display_port =
+        self.base.stacking_relative_position_of_display_port;
 }
index 7ebffdc2889bec2a998576619e0ba883b2a812f4..75156347978e1042f99673a686bd1db29f92de02 100644 (file)
@@ -276,12 +276,14 @@ fn issue494() {
             hir::StmtExpr(ref expr, id) |
             hir::StmtSemi(ref expr, id) => {
                 result.push(StmtRef::Mirror(Box::new(Stmt {
-                    span: stmt.span,
-                    kind: StmtKind::Expr {
-                        scope: cx.tcx.region_maps.node_extent(id),
-                        expr: expr.to_ref(),
-                    },
-                })))
+                                                         span: stmt.span,
+                                                         kind: StmtKind::Expr {
+                                                             scope: cx.tcx
+                                                                 .region_maps
+                                                                 .node_extent(id),
+                                                             expr: expr.to_ref(),
+                                                         },
+                                                     })))
             }
         }
     }
index 05840b703d31078e875f24c825e4aad8b0a1435e..3fc817d64a6e9f9233cc8086415573ef6a435567 100644 (file)
@@ -49,11 +49,11 @@ fn main() {
     };
 
     Some(Data::MethodCallData(MethodCallData {
-        span: sub_span.unwrap(),
-        scope: self.enclosing_scope(id),
-        ref_id: def_id,
-        decl_id: Some(decl_id),
-    }));
+                                  span: sub_span.unwrap(),
+                                  scope: self.enclosing_scope(id),
+                                  ref_id: def_id,
+                                  decl_id: Some(decl_id),
+                              }));
 
     Diagram {
         //                 o        This graph demonstrates how
index 0eb7b8b759f72822c651423731d46b2ed4739c73..7cd2acd958fc1d88634c796439f3b3f787d7536d 100644 (file)
@@ -59,11 +59,11 @@ fn main() {
     };
 
     Some(Data::MethodCallData(MethodCallData {
-        span: sub_span.unwrap(),
-        scope: self.enclosing_scope(id),
-        ref_id: def_id,
-        decl_id: Some(decl_id),
-    }));
+                                  span: sub_span.unwrap(),
+                                  scope: self.enclosing_scope(id),
+                                  ref_id: def_id,
+                                  decl_id: Some(decl_id),
+                              }));
 
     Diagram {
         //                 o        This graph demonstrates how