rust/tests/target/comments-fn.rs
Kevin Yeh 4d7de5a16e Support single-line functions
By default, places functions with empty bodies on one line.
If the function has only one expression or statement that fits on one line, the 'fn_single_line' option can be used.
2015-11-19 14:23:56 -06:00

22 lines
598 B
Rust

// 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 */ { }