-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
struct_field_align with shorthand and rest/base
This works with the new target files, but breaks in surprising previously working places. test with cargo +nightly-2025-01-02 test system_tests -- --nocapture
- Loading branch information
Showing
8 changed files
with
153 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// rustfmt-struct_field_align_threshold: 30 | ||
|
||
#[derive(Default)] | ||
struct Foo { | ||
id: u8, | ||
age: u8, | ||
name: String, | ||
} | ||
|
||
fn main() { | ||
foo = Foo { | ||
id: 5, | ||
name: "John".into(), | ||
..Default::default() | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// rustfmt-struct_field_align_threshold: 30 | ||
|
||
struct Foo { | ||
id: u8, | ||
name: String, | ||
x: u8, | ||
} | ||
|
||
fn main() { | ||
let x = 5; | ||
|
||
foo = Foo { | ||
id: 3, | ||
x, | ||
name: "John".into(), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// rustfmt-struct_field_align_threshold: 30 | ||
|
||
#[derive(Default)] | ||
struct Foo { | ||
id: u8, | ||
age: u8, | ||
name: String, | ||
} | ||
|
||
fn main() { | ||
foo = Foo { | ||
id: 5, | ||
name: "John".into(), | ||
..Default::default() | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// rustfmt-struct_field_align_threshold: 30 | ||
|
||
struct Foo { | ||
id: u8, | ||
name: String, | ||
x: u8, | ||
} | ||
|
||
fn main() { | ||
let x = 5; | ||
|
||
foo = Foo { | ||
id: 3, | ||
x, | ||
name: "John".into(), | ||
}; | ||
} |