rust/tests/target/comments-fn.rs

40 lines
691 B
Rust
Raw Normal View History

// Test comments on functions are preserved.
// Comment on foo.
2017-06-11 23:01:41 -05:00
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
2019-02-18 20:56:42 -06:00
F: Foo, // COmment after where-clause
2017-06-11 23:01:41 -05:00
G: Goo, // final comment
{
}
fn bar<F /* comment on F */, G /* comment on G */>() {}
fn baz() -> Baz /* Comment after return type */ {}
2017-06-11 23:01:41 -05:00
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);
()
}