Add a test for #2343 and update tests

This commit is contained in:
Seiichi Uchida 2018-01-11 16:53:13 +09:00
parent 279acda4c4
commit 6e05ca87b0
8 changed files with 25 additions and 7 deletions

View File

@ -0,0 +1,5 @@
// rustfmt-max_width: 80
struct Foo {
#[cfg(feature = "serde")] bytes: [[u8; 17]; 5], // Same size as signature::ED25519_PKCS8_V2_LEN
}

View File

@ -62,7 +62,8 @@ impl Bar {
// #984
struct Foo {
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)] foo: usize,
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
foo: usize,
}
// #1668

View File

@ -40,7 +40,8 @@ pub struct Foo {
f : SomeType, // Comment beside a field
f: SomeType, // Comment beside a field
// Comment on a field
#[AnAttribute] g: SomeOtherType,
#[AnAttribute]
g: SomeOtherType,
/// A doc comment on a field
h: AThirdType,
pub i: TypeForPublicField,

View File

@ -42,7 +42,8 @@ enum StructLikeVariants {
StructLike {
x: i32, // Test comment
// Pre-comment
#[Attr50] y: SomeType, // Aanother Comment
#[Attr50]
y: SomeType, // Aanother Comment
},
SL {
a: A,

View File

@ -0,0 +1,6 @@
// rustfmt-max_width: 80
struct Foo {
#[cfg(feature = "serde")]
bytes: [[u8; 17]; 5], // Same size as signature::ED25519_PKCS8_V2_LEN
}

View File

@ -4,7 +4,8 @@
struct Foo {
bar: u64,
#[cfg(test)] qux: u64,
#[cfg(test)]
qux: u64,
}
fn do_something() -> Foo {
@ -23,7 +24,8 @@ fn main() {
// #1462
struct Foo {
foo: usize,
#[cfg(feature = "include-bar")] bar: usize,
#[cfg(feature = "include-bar")]
bar: usize,
}
fn new_foo() -> Foo {

View File

@ -8,7 +8,8 @@ pub struct Foo {
f : SomeType, // Comment beside a field
f: SomeType, // Comment beside a field
// Comment on a field
#[AnAttribute] g: SomeOtherType,
#[AnAttribute]
g: SomeOtherType,
/// A doc comment on a field
h: AThirdType,
pub i: TypeForPublicField,

View File

@ -8,7 +8,8 @@ pub union Foo {
f : SomeType, // Comment beside a field
f: SomeType, // Comment beside a field
// Comment on a field
#[AnAttribute] g: SomeOtherType,
#[AnAttribute]
g: SomeOtherType,
/// A doc comment on a field
h: AThirdType,
pub i: TypeForPublicField,