Commit Graph

79 Commits

Author SHA1 Message Date
Yacin Tmimi
348a499e8b Merge remote-tracking branch 'upstream/master' into subtree-push-nightly-2024-09-10 2024-09-10 01:15:02 -04:00
Yacin Tmimi
ae59ee755a sort rustfmt imports
The version-sort algorithm makes changes to the sort order of imports,
and we're updating them here for the self tests.
2024-09-03 15:21:36 -04:00
ding-young
35b3889c77 impl rewrite_result for ControlFlow, Stmt, update rewrite_index 2024-09-01 10:15:00 -04:00
Nicholas Nethercote
c3beb05687 Remove #[macro_use] extern crate tracing from rustfmt. 2024-08-30 13:35:05 +10:00
Caleb Cartwright
cf352a766f chore: apply review suggestions 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
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
071ca7dc45 refactor rewrite_closure 2024-07-15 14:34:56 -06:00
Michael Goulet
10277c97c2 Implement use<> formatting in rustfmt 2024-06-23 10:57:10 -04:00
Caleb Cartwright
ebce054347 Merge commit 'e4944185ae09c99f59b460e358909f329010ea9c' into sync-from-rustfmt-24-06 2024-06-22 15:33:45 -05:00
Eric Holk
0315daafee Plumb awaitness of for loops 2023-12-19 12:26:20 -08:00
Caleb Cartwright
ed3e96e3d1 Merge commit '3f7c366fc0464e01ddcaefbd70647cb3da4202be' into rustfmt-sync 2023-06-19 23:13:56 -05:00
Nicholas Nethercote
c7e4abd444 Rename NestedMetaItem::[Ll]iteral as NestedMetaItem::[Ll]it.
We already use a mix of `Literal` and `Lit`. The latter is better
because it is shorter without causing any ambiguity.
2022-11-28 15:18:53 +11:00
Caleb Cartwright
d03a547cad Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rustfmt 2022-06-12 22:03:05 -05:00
Vadim Petrochenkov
70067e31ed rustc_ast: Harmonize delimiter naming with proc_macro::Delimiter 2022-04-28 10:04:29 +03:00
Caleb Cartwright
8211d64c71 Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree 2022-03-29 23:17:30 -05:00
Caleb Cartwright
f99e3582bd Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync 2021-11-07 20:37:34 -06:00
Caleb Cartwright
2b41b6d022 Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree 2021-10-20 00:11:59 -05:00
Caleb Cartwright
e4b8714c09 Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt 2021-07-25 22:57:19 -05:00
Caleb Cartwright
1bcc1f8df5 refactor: apply heuristic config changes in lib 2021-04-21 21:27:50 -05:00
Caleb Cartwright
4948911608 deps: apply rustc-ap-* v712 changes 2021-04-02 23:21:06 -05:00
Caleb Cartwright
b173b42354 refactor: rename libsyntax --> rustc_ast 2020-03-27 22:29:12 -05:00
Caleb Cartwright
c60416ed21 deps: update rustc-ap to v642.0.0 2020-02-08 22:21:37 -06:00
Seiichi Uchida
383306e5fe
Update rustc-ap-* crates to 606.0.0 (#3835) 2019-10-05 23:40:24 +09:00
Shotaro Yamada
ca78653d61 Use Cell instead of RefCell (#3798) 2019-09-18 22:37:08 +09:00
Caleb Cartwright
ac150d016b fix: remove trailing space with empty dyn macro arg (#3737) 2019-08-11 12:49:14 +09:00
Seiichi Uchida
983a92c872
Update rustc-ap-* crates to 541.0.0 (#3707) 2019-07-29 05:52:45 +09:00
Seiichi Uchida
2244f326e6
Cargo update (#3559)
Update `rustc-ap-*` crates to 486.0.0.
2019-06-03 23:57:02 +09:00
Ruben Schmidmeister
618d092bf7
Enable unreachable_pub lint 2019-05-09 20:37:51 +02:00
Seiichi Uchida
5dd042c152
Merge pull request #3511 from topecongiro/issue3498
Avoid overflowing item with attributes
2019-04-17 11:40:00 -07:00
topecongiro
d3e578b131 Avoid overflowing item if it has attributes 2019-04-14 20:45:04 +09:00
Shotaro Yamada
ff0683d666 Simplify iterators 2019-03-29 19:06:32 +09:00
Alexander Regueiro
7a3b7c9275 Various cosmetic improvements (#3403) 2019-02-19 11:56:42 +09:00
Seiichi Uchida
ce682bdabc
Merge pull request #3335 from h-michael/rust-2018
Rust 2018 idioms
2019-02-11 01:12:38 +09:00
topecongiro
9a7ea6aacb Handle a macro argument with a single keyword
Closes #3331.
2019-02-11 00:34:23 +09:00
Hirokazu Hata
8183b949c4 cargo fmt 2019-02-09 16:20:38 +09:00
Hirokazu Hata
4bb90f5cc8 Fix rust_2018_idioms warnings 2019-02-09 16:14:30 +09:00
Evgenii
ece629b1cc transition to Rust 2018 2019-02-04 13:30:43 +03:00
topecongiro
154ccf6a02 Do not force trailing comma when using mixed layout 2019-01-31 23:44:58 +09:00
topecongiro
181ca427dc Use the same rule with macro and function calls with a single chain 2019-01-28 23:05:42 +09:00
topecongiro
5df0a18849 Avoid putting a long macro call in a single line 2019-01-28 23:05:39 +09:00
wada314
a01990c4d0 Use Unicode-standard char width to wrap comments or strings. (#3275) 2019-01-15 08:41:09 +09:00
Kevin Stenerson
25b828d35f Add config option to more aggressively allow overflow 2018-11-05 21:12:40 -07:00
Matthias Krüger
8c996331cc fix a couple of clippy lint warnings
simplify a comparison with "true"
fn can_be_overflowed: remove unused lifetime
fn rewrite_pairs_one_line: pass "list" by reference (it is not consumed in the function)
fn span_for_token_stream: pass "token_stream" by reference since it is not consumed
use tool lints for clippy suppressions
2018-10-19 01:11:28 +02:00
Nick Cameron
613dfcc521 Remove various feature flags 2018-10-18 15:38:57 +13:00
Shotaro Yamada
751bcf5fa0 Clippy 2018-10-15 23:59:08 +09:00
Otavio Salvador
ef59b34cd7 Avoid control flow expressions conditions to go multi line
Extends the multi line condition to over other control flow
expressions, it now covers: `if`, `if let`, `for`, `loop`, `while`,
`while let` and `match`.

Refs: #3029

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-13 14:12:43 -03:00
Otavio Salvador
8feeddf1f8 Only combine match if its condition expression fits in a single line
This improves the formatting and reading of code avoiding the
condition expression to be rewrite, if it goes multi line.

Fixes: #3029.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-12 20:12:45 -03:00