]> git.lizzy.rs Git - rust.git/commitdiff
Add test for empty tuple struct with comment
authortopecongiro <seuchida@gmail.com>
Fri, 14 Apr 2017 13:39:20 +0000 (22:39 +0900)
committerSeiichi Uchida <topecongiro@localhost.localdomain>
Tue, 2 May 2017 01:21:39 +0000 (10:21 +0900)
src/items.rs
tests/source/structs.rs
tests/target/structs.rs

index ff24a87ec60621afdacab52228af895d8ab73b8a..8ea97b177e86013d9e9a2ad4b190af12b58c242b 100644 (file)
@@ -1029,7 +1029,7 @@ fn format_tuple_struct(context: &RewriteContext,
         result.push('(');
         let snippet = context.snippet(mk_sp(body_lo, context.codemap.span_before(span, ")")));
         if snippet.is_empty() {
-            //
+            // `struct S ()`
         } else if snippet
                       .trim_right_matches(&[' ', '\t'][..])
                       .ends_with('\n') {
index 5786fef4839e0651a3db902c083ce149bf85291f..28bb95e1a2de3441fe83d784bea1d1612ef72156 100644 (file)
@@ -166,7 +166,7 @@ struct Foo {
 
     }
 struct Foo { /* comment */ }
-struct Foo();
+struct Foo( /* comment */ );
 
 struct LongStruct {
     a: A,
index 2906d39759b7e495e113017edf6d6e97a2157d02..358172ae83835ff8ec67c5de94b72f4f3659dfd3 100644 (file)
@@ -170,7 +170,7 @@ struct Foo {
     // trailing space ->
 }
 struct Foo { /* comment */ }
-struct Foo();
+struct Foo( /* comment */ );
 
 struct LongStruct {
     a: A,