Mattias Wallin
5d30ce6844
Avoid allocating intermediate strings in determine_operation
2024-09-02 22:42:53 -04:00
Mattias Wallin
9d407bfd1b
Avoid allocating intermediate strings in ItemizedBlock::trimmed_block_as_string
2024-09-02 22:42:53 -04:00
Mattias Wallin
40909b4331
Fix test_editions_2015_2018_2021_identical
...
Was comparing unit type.
2024-09-01 11:00:56 -04:00
ding-young
35b3889c77
impl rewrite_result for ControlFlow, Stmt, update rewrite_index
2024-09-01 10:15:00 -04:00
ding-young
193051438d
update rewrite_assignment to return RewriteResult
2024-09-01 09:07:21 -04:00
Caleb Cartwright
46cb7d3220
refactor: improve mapping of legacy 'version' to 'style_edition'
2024-08-27 20:49:15 -05:00
Caleb Cartwright
065258659d
feat: implement 2024 Style Edition for expr overflows
2024-08-27 20:49:15 -05:00
Caleb Cartwright
0c6515cacc
feat: support style edition differing defaults in config loading
2024-08-27 20:49:15 -05:00
Caleb Cartwright
c0c3dc7a25
refactor: include edition & style edition in CliOptions
2024-08-27 20:49:15 -05:00
Caleb Cartwright
53d5ccd5e9
refactor: use style edition when loading from partial config
2024-08-27 20:49:15 -05:00
beetrees
5ee4d3b532
Remove outdated comment from mac.yml
2024-08-26 15:31:28 -04:00
ding-young
6f5e99b7b5
update macro rewrite functions to return RewriteResult
2024-08-25 09:23:04 -04:00
Yacin Tmimi
448906160d
Merge pull request #6285 from ytmimi/subtree-push-nightly-2024-08-17
...
subtree-push nightly-2024-08-17
2024-08-19 19:04:27 -04:00
Yacin Tmimi
d34fca4f01
bump toolchain to nightly-2024-08-17
2024-08-17 14:38:27 -04:00
Yacin Tmimi
6bcadd6aa4
Merge remote-tracking branch 'upstream/master' into subtree-push-nightly-2024-08-17
2024-08-17 14:36:42 -04:00
ding-young
fbe04244f8
update rewrite_chain to return RewriteResult
2024-08-15 12:32:26 -04:00
Lukasz Anforowicz
caaa612a0b
Ensure that fn config_path
returns canonicalized paths.
...
This commit ensures that `fn config_path` in `rustfmt/src/config/mod.rs`
always returns canonicalized paths. This is achieved by canonicalizing
both: 1) paths received via `CliOptions` (after checking if the path
exists) as well as 2) paths returned via `get_toml_path` (canonicalizing
within `fn get_toml_path`).
Fixes https://github.com/rust-lang/rustfmt/issues/6178
2024-08-14 15:02:38 -04:00
ding-young
68dc912b99
update rewrite functions in imports.rs
2024-08-14 12:36:26 -04:00
Nicholas Nethercote
7b2299a2d2
Use impl PartialEq<TokenKind> for Token
more.
...
This lets us compare a `Token` with a `TokenKind`. It's used a lot, but
can be used even more, avoiding the need for some `.kind` uses.
2024-08-14 16:37:09 +10:00
John Kåre Alsaker
57af02c9c4
Link std
statically in rustc_driver
2024-08-11 04:16:53 +02:00
ding-young
40f5075269
impl rewrite_result for Pat, TuplePatField
...
- also update rewrite_unary_*** to return RewriteResult
2024-08-05 07:53:46 -06:00
David Tolnay
88944668fe
Print empty commit info without trailing hyphen
2024-08-04 12:44:32 -06:00
David Tolnay
15c75fec4f
Check exit status of git commands spawned by build script
2024-08-04 12:44:32 -06:00
David Tolnay
17c5869dff
Print a deterministic length of commit hash in --version
2024-08-04 08:00:40 -06:00
benluiwj
a1361bd0d5
Run check-diff tests in ci
2024-08-03 05:17:27 -06:00
benluiwj
63d50dd1d7
Add cd
and git clone
functionality to check-diff crate
...
Included unit tests for the new functionality as well.
2024-08-03 05:17:27 -06:00
ding-young
b8a5b211ef
impl rewrite_result for ChainItem
2024-08-03 04:43:03 -06:00
ding-young
3d468e2d92
update combine_strs_with_missing_comments
2024-08-03 04:43:03 -06:00
ding-young
5325b9e98c
modify rewrite_literal
2024-08-03 04:43:03 -06:00
Jubilee Young
6159460963
rustfmt: Remove has_cpuid
from test
2024-08-02 02:12:29 -07:00
Michael Goulet
90a86a78d2
Suppress must_use on eat calls in rustfmt
2024-07-30 10:10:36 -04:00
Caleb Cartwright
cf352a766f
chore: apply review suggestions
2024-07-28 19:37:36 -05:00
Caleb Cartwright
d66ab31b53
tests: add new load_config tests
2024-07-28 19:37:36 -05:00
Caleb Cartwright
d65daa9c4f
refactor: rebase with set_cli() behavior
2024-07-28 19:37:36 -05:00
Caleb Cartwright
7a5a936e79
docs: use StyleEdition in dev guide
...
s
2024-07-28 19:37:36 -05:00
Caleb Cartwright
aa8a53f687
refactor: switch idempotence/system tests to style_edition
...
Updates all the various files utilized in the system and
idempotence tests to directly use the corresponding
'style_edition' configuration as opposed to keeping
the original 'version' values and relying on the mapping.
2024-07-28 19:37:36 -05:00
Caleb Cartwright
e04e411852
tests: validate style_edition derivation
...
Adds a few tests that validate the various scenarios
of precendence, overrides, and defaults to ensure the
correct 'style_edition' value is selected even when
other options like 'edition' and/or 'version' are included.
2024-07-28 19:37:36 -05:00
Caleb Cartwright
b6c89fc657
feat: add --style-edition option to rustfmt binary
2024-07-28 19:37:36 -05:00
Caleb Cartwright
7c41e2bfba
refactor: switch from 'version' to 'style_edition'
...
Updates the relevant formatting logic to utilize the
new 'style_edition' option directly instead of the now
deprecated 'version' option. 'version' has only been
soft deprecated and has auto mapping in place so there
should be zero formatting impact to current 'version' users.
2024-07-28 19:37:36 -05:00
Caleb Cartwright
c2c9be5b2d
feat: implement Style Edition support
...
Adds the 'style_edition' configuration option along with
documentation, 'version' option deprecation, and mapping
of 'edition' and 'version' values for backwards compatibility
and adherence to the style evolution RFC
2024-07-28 19:37:36 -05:00
Caleb Cartwright
d8ae6a99e6
tests: add a few for style edition config defaults
2024-07-27 17:35:10 -05:00
Caleb Cartwright
a23d3ccb84
refactor: track configs set from cli flags
2024-07-27 17:01:11 -05:00
ding-young
e21c1e220b
refactor rewrite_array, pair, tuple, call
2024-07-26 03:53:21 -06:00
ding-young
1313d61842
modfiy ListItem to hold RewriteResult as the item field
2024-07-26 03:00:49 -06:00
ding-young
6ccf539b19
modify trait bound of itemize_list
2024-07-26 03:00:49 -06:00
ding-young
ea02de27ff
refactor rewrite_match and impl rewrite_result for ArmWrapper
2024-07-17 20:51:42 -06:00
ding-young
babc2f9b8a
modify rewrite_struct_lit, rewrite_struct_pat
...
- refactor rewrite_*** functions that call rewrite_path to return RewriteResult
- modify rewrite_aligned_item method of AlignedItem
2024-07-17 18:40:45 -06:00
ding-young
3cbc91e9d6
modify rewrite_path and impl rewrite_result for related AST nodes
2024-07-17 18:40:45 -06:00
Yacin Tmimi
7cdb426c05
Implement StyleEditionDefault
for each config option
...
Makes internal changes to define each configuration in terms of the
`StyleEditionDefault` trait, and hard codes `StyleEdition::Edition2015`
anywhere the new `style_edition` is needed.
**Note** users are still unable to configure `style edition`.
2024-07-15 15:41:31 -06:00
ding-young
071ca7dc45
refactor rewrite_closure
2024-07-15 14:34:56 -06:00