summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/comments-fn.rs
blob: 1f43bd93bb0cb6558fa84ec2968760c8f42bec8a (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
// Test comments on functions are preserved.

// Comment on foo.
fn foo<F, G>(
    a: aaaaaaaaaaaaa, // A comment
    b: bbbbbbbbbbbbb, // a second comment
    c: ccccccccccccc,
    // Newline comment
    d: ddddddddddddd,
    //  A multi line comment
    // between args.
    e: eeeeeeeeeeeee, /* comment before paren */
) -> bar
where
    F: Foo, // COmment after where-clause
    G: Goo, // final comment
{
}

fn bar<F /* comment on F */, G /* comment on G */>() {}

fn baz() -> Baz /* Comment after return type */ {}

fn some_fn<T>()
where
    T: Eq, // some comment
{
}

fn issue458<F>(a: &str, f: F)
// comment1
where
    // comment2
    F: FnOnce(&str) -> bool,
{
    f(a);
    ()
}