]> git.lizzy.rs Git - rust.git/commitdiff
Use visual indent style in where-clause.rs
authortopecongiro <seuchida@gmail.com>
Fri, 23 Feb 2018 07:09:20 +0000 (16:09 +0900)
committertopecongiro <seuchida@gmail.com>
Fri, 23 Feb 2018 13:53:16 +0000 (22:53 +0900)
rustfmt-core/tests/source/where-clause.rs
rustfmt-core/tests/target/where-clause.rs

index 9e4a2f656988be497dab08a009589f98dc1eeca3..2a9160825487a1acce8fb777e955573ae4dfb7b8 100644 (file)
@@ -1,5 +1,32 @@
+// rustfmt-indent_style: Visual
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo, U: Bar {
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo {
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape, shape: &Shape) where T: FOo, U: Bar {
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape, shape: &Shape) where T: FOo {
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) -> Option<String> where T: FOo, U: Bar {
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) -> Option<String> where T: FOo {
+    let mut effects = HashMap::new();
+}
+
 pub trait Test {
     fn very_long_method_name<F>(self, f: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool;
+
     fn exactly_100_chars1<F>(self, f: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool;
 }
 
@@ -14,3 +41,18 @@ struct Exactly100CharsToSemicolon<A, B, C, D, E>
 struct AlwaysOnNextLine<LongLongTypename, LongTypename, A, B, C, D, E, F> where A: LongTrait {
     x: i32
 }
+
+pub trait SomeTrait<T>
+    where
+    T: Something + Sync + Send + Display     + Debug     + Copy + Hash + Debug + Display + Write + Read + FromStr
+{
+}
+
+// #2020
+impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
+    fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand: F)
+    where F: for<'b> FnMut(&mut ProbeContext<'b, 'gcx, 'tcx>, ty::PolyTraitRef<'tcx>, ty::AssociatedItem),
+    {
+        // ...
+    }
+}
index 724f3b34bf0b623668fc9992980a865c72c85ff3..def18a0c11a8d02b37ec1362510e81cedb2e53be 100644 (file)
+// rustfmt-indent_style: Visual
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape)
+    where T: FOo,
+          U: Bar
+{
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape)
+    where T: FOo
+{
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode,
+                              rule: &Rule,
+                              args: &[Arg],
+                              shape: &Shape,
+                              shape: &Shape)
+    where T: FOo,
+          U: Bar
+{
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode,
+                              rule: &Rule,
+                              args: &[Arg],
+                              shape: &Shape,
+                              shape: &Shape)
+    where T: FOo
+{
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode,
+                              rule: &Rule,
+                              args: &[Arg],
+                              shape: &Shape)
+                              -> Option<String>
+    where T: FOo,
+          U: Bar
+{
+    let mut effects = HashMap::new();
+}
+
+fn reflow_list_node_with_rule(node: &CompoundNode,
+                              rule: &Rule,
+                              args: &[Arg],
+                              shape: &Shape)
+                              -> Option<String>
+    where T: FOo
+{
+    let mut effects = HashMap::new();
+}
+
 pub trait Test {
     fn very_long_method_name<F>(self, f: F) -> MyVeryLongReturnType
-    where
-        F: FnMut(Self::Item) -> bool;
+        where F: FnMut(Self::Item) -> bool;
+
     fn exactly_100_chars1<F>(self, f: F) -> MyVeryLongReturnType
-    where
-        F: FnMut(Self::Item) -> bool;
+        where F: FnMut(Self::Item) -> bool;
 }
 
 fn very_long_function_name<F>(very_long_argument: F) -> MyVeryLongReturnType
-where
-    F: FnMut(Self::Item) -> bool,
+    where F: FnMut(Self::Item) -> bool
 {
 }
 
 struct VeryLongTupleStructName<A, B, C, D, E>(LongLongTypename, LongLongTypename, i32, i32)
-where
-    A: LongTrait;
+    where A: LongTrait;
 
-struct Exactly100CharsToSemicolon<A, B, C, D, E>(LongLongTypename, i32, i32)
-where
-    A: LongTrait1234;
+struct Exactly100CharsToSemicolon<A, B, C, D, E>(LongLongTypename, i32, i32) where A: LongTrait1234;
 
 struct AlwaysOnNextLine<LongLongTypename, LongTypename, A, B, C, D, E, F>
-where
-    A: LongTrait,
+    where A: LongTrait
 {
     x: i32,
 }
+
+pub trait SomeTrait<T>
+    where T: Something
+                 + Sync
+                 + Send
+                 + Display
+                 + Debug
+                 + Copy
+                 + Hash
+                 + Debug
+                 + Display
+                 + Write
+                 + Read
+                 + FromStr
+{
+}
+
+// #2020
+impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
+    fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand: F)
+        where F: for<'b> FnMut(&mut ProbeContext<'b, 'gcx, 'tcx>,
+                               ty::PolyTraitRef<'tcx>,
+                               ty::AssociatedItem)
+    {
+        // ...
+    }
+}