mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 19:33:16 +00:00
Add a test for #2343 and update tests
This commit is contained in:
parent
279acda4c4
commit
6e05ca87b0
5
tests/source/issue-2342.rs
Normal file
5
tests/source/issue-2342.rs
Normal 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
|
||||
}
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
6
tests/target/issue-2342.rs
Normal file
6
tests/target/issue-2342.rs
Normal 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
|
||||
}
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user