]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/where-clause.rs
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
[rust.git] / src / tools / rustfmt / tests / source / where-clause.rs
1 // rustfmt-indent_style: Visual
2
3 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo, U: Bar {
4     let mut effects = HashMap::new();
5 }
6
7 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo {
8     let mut effects = HashMap::new();
9 }
10
11 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape, shape: &Shape) where T: FOo, U: Bar {
12     let mut effects = HashMap::new();
13 }
14
15 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape, shape: &Shape) where T: FOo {
16     let mut effects = HashMap::new();
17 }
18
19 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) -> Option<String> where T: FOo, U: Bar {
20     let mut effects = HashMap::new();
21 }
22
23 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) -> Option<String> where T: FOo {
24     let mut effects = HashMap::new();
25 }
26
27 pub trait Test {
28     fn very_long_method_name<F>(self, f: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool;
29
30     fn exactly_100_chars1<F>(self, f: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool;
31 }
32
33 fn very_long_function_name<F>(very_long_argument: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool { }
34
35 struct VeryLongTupleStructName<A, B, C, D, E>(LongLongTypename, LongLongTypename, i32, i32) where A: LongTrait;
36
37 struct Exactly100CharsToSemicolon<A, B, C, D, E>
38     (LongLongTypename, i32, i32)
39     where A: LongTrait1234;
40
41 struct AlwaysOnNextLine<LongLongTypename, LongTypename, A, B, C, D, E, F> where A: LongTrait {
42     x: i32
43 }
44
45 pub trait SomeTrait<T>
46     where
47     T: Something + Sync + Send + Display     + Debug     + Copy + Hash + Debug + Display + Write + Read + FromStr
48 {
49 }
50
51 // #2020
52 impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
53     fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand: F)
54     where F: for<'b> FnMut(&mut ProbeContext<'b, 'gcx, 'tcx>, ty::PolyTraitRef<'tcx>, ty::AssociatedItem),
55     {
56         // ...
57     }
58 }