summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/where-clause.rs
blob: eb2f8d5e6e81ec47badcc0a62f16e5b4dbf51c54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// 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;
}

fn very_long_function_name<F>(very_long_argument: F) -> MyVeryLongReturnType
    where F: FnMut(Self::Item) -> bool
{
}

struct VeryLongTupleStructName<A, B, C, D, E>(LongLongTypename, LongLongTypename, i32, i32)
    where A: LongTrait;

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
{
    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)
    {
        // ...
    }
}