]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/where-clause.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / rustfmt / tests / target / where-clause.rs
1 // rustfmt-indent_style: Visual
2
3 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape)
4     where T: FOo,
5           U: Bar
6 {
7     let mut effects = HashMap::new();
8 }
9
10 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape)
11     where T: FOo
12 {
13     let mut effects = HashMap::new();
14 }
15
16 fn reflow_list_node_with_rule(node: &CompoundNode,
17                               rule: &Rule,
18                               args: &[Arg],
19                               shape: &Shape,
20                               shape: &Shape)
21     where T: FOo,
22           U: Bar
23 {
24     let mut effects = HashMap::new();
25 }
26
27 fn reflow_list_node_with_rule(node: &CompoundNode,
28                               rule: &Rule,
29                               args: &[Arg],
30                               shape: &Shape,
31                               shape: &Shape)
32     where T: FOo
33 {
34     let mut effects = HashMap::new();
35 }
36
37 fn reflow_list_node_with_rule(node: &CompoundNode,
38                               rule: &Rule,
39                               args: &[Arg],
40                               shape: &Shape)
41                               -> Option<String>
42     where T: FOo,
43           U: Bar
44 {
45     let mut effects = HashMap::new();
46 }
47
48 fn reflow_list_node_with_rule(node: &CompoundNode,
49                               rule: &Rule,
50                               args: &[Arg],
51                               shape: &Shape)
52                               -> Option<String>
53     where T: FOo
54 {
55     let mut effects = HashMap::new();
56 }
57
58 pub trait Test {
59     fn very_long_method_name<F>(self, f: F) -> MyVeryLongReturnType
60         where F: FnMut(Self::Item) -> bool;
61
62     fn exactly_100_chars1<F>(self, f: F) -> MyVeryLongReturnType
63         where F: FnMut(Self::Item) -> bool;
64 }
65
66 fn very_long_function_name<F>(very_long_argument: F) -> MyVeryLongReturnType
67     where F: FnMut(Self::Item) -> bool
68 {
69 }
70
71 struct VeryLongTupleStructName<A, B, C, D, E>(LongLongTypename, LongLongTypename, i32, i32)
72     where A: LongTrait;
73
74 struct Exactly100CharsToSemicolon<A, B, C, D, E>(LongLongTypename, i32, i32) where A: LongTrait1234;
75
76 struct AlwaysOnNextLine<LongLongTypename, LongTypename, A, B, C, D, E, F>
77     where A: LongTrait
78 {
79     x: i32,
80 }
81
82 pub trait SomeTrait<T>
83     where T: Something
84               + Sync
85               + Send
86               + Display
87               + Debug
88               + Copy
89               + Hash
90               + Debug
91               + Display
92               + Write
93               + Read
94               + FromStr
95 {
96 }
97
98 // #2020
99 impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
100     fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand: F)
101         where F: for<'b> FnMut(&mut ProbeContext<'b, 'gcx, 'tcx>,
102                                ty::PolyTraitRef<'tcx>,
103                                ty::AssociatedItem)
104     {
105         // ...
106     }
107 }