Commit Graph

258 Commits

Author SHA1 Message Date
Lieselotte 1bbfb76993 Add ErrorGuaranteed to ast::ExprKind::Err 2024-02-25 22:24:31 +01:00
Lieselotte 7d82dd0d31 Add ast::ExprKind::Dummy 2024-02-25 22:22:09 +01:00
Eric Holk 0315daafee Plumb awaitness of for loops 2023-12-19 12:26:20 -08:00
Michael Goulet 3ffacf75fe Make some matches exhaustive to avoid bugs, fix tools 2023-12-08 17:23:26 +00:00
Michael Goulet 6ebb66cea9 coro_kind -> coroutine_kind 2023-12-08 17:23:25 +00:00
Eric Holk 13d284d177 Option<CoroutineKind> 2023-12-04 13:03:37 -08:00
Eric Holk 97fdae1034 Merge Async and Gen into CoroutineKind 2023-12-04 12:48:01 -08:00
Oli Scherer a3be235fcc Add gen blocks to ast and do some broken ast lowering 2023-10-27 13:05:48 +00:00
Caleb Cartwright 04bd7201a9 Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
Nilstrieb aca22c73fd Improve spans for indexing expressions
Indexing is similar to method calls in having an arbitrary
left-hand-side and then something on the right, which is the main part
of the expression. Method calls already have a span for that right part,
but indexing does not. This means that long method chains that use
indexing have really bad spans, especially when the indexing panics and
that span in coverted into a panic location.

This does the same thing as method calls for the AST and HIR, storing an
extra span which is then put into the `fn_span` field in THIR.
2023-08-04 13:17:39 +02:00
Maybe Waffle dc7dc3e74c Implement become expression formatting in rustfmt 2023-06-19 12:54:34 +00:00
DrMeepster 84385bff42 offset_of 2023-04-21 02:14:02 -07:00
clubby789 4e658cc01e Remove box_syntax from AST and use in tools 2023-03-12 13:19:46 +00:00
bors 6d133152f8 Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
Move format_args!() into AST (and expand it during AST lowering)

Implements https://github.com/rust-lang/compiler-team/issues/541

This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier.

This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`.

This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-26 12:44:47 +00:00
Caleb Cartwright 094b7f599c Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt 2023-01-24 14:16:03 -06:00
Mara Bos 80d196d789 Update rustfmt for ast::ExprKind::FormatArgs.
Rustfmt doesn't expand macros, so that's easy: FormatArgs nodes do not
occur in the unexpanded AST.
2023-01-12 00:25:46 +01: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
Nicholas Nethercote 4a4addc598 Box ExprKind::{Closure,MethodCall}, and QSelf in expressions, types, and patterns. 2022-11-17 13:45:59 +11:00
clubby789 660e53512f Introduce ExprKind::IncludedBytes 2022-11-11 16:31:32 +00:00
Maybe Waffle 2964d0a533 implement rustfmt formatting for for<> closure binders 2022-07-12 21:00:13 +04:00
Nixon Enraght-Moony 45f4f6ccf7 ast: Add span to Extern 2022-07-02 23:30:03 +01:00
Jacob Pratt 9b697d0b90 Merge crate and restricted visibilities 2022-05-21 17:02:55 -04:00
Jacob Pratt 0d27f70743 Remove feature: crate visibility modifier 2022-05-21 14:22:06 -04:00
Scott McMurray 050978ba43 Fix the rustfmt build 2022-04-30 17:40:29 -07:00
Caleb Cartwright 8211d64c71 Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree 2022-03-29 23:17:30 -05:00
Tomasz Miąsko 04670a1404 Remove LLVM-style inline assembly from rustfmt 2022-01-12 21:43:35 +01:00
Nicholas Nethercote 3bb5f81d8d Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
Caleb Cartwright f99e3582bd Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync 2021-11-07 20:37:34 -06:00
Camille GILLOT 127ec9a8c9 Keep a parent LocalDefId in SpanData. 2021-09-10 20:17:33 +02:00
Caleb Cartwright e4b8714c09 Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt 2021-07-25 22:57:19 -05:00
Camille GILLOT 277feac1f9 Use LocalExpnId where possible. 2021-07-17 19:41:02 +02:00
Caleb Cartwright cbd83b8083 chore: add span creation util function 2021-04-02 23:21:06 -05:00
hafiz 269584634a Include constness in impl blocks (#4215)
Closes #4084
2021-01-27 18:50:03 -06:00
Caleb Cartwright 4d9fa00fd5 feat: support underscore expressions 2020-11-28 17:41:21 -06:00
Caleb Cartwright a613c57521 feat: don't insert semi in macro_rules arm body 2020-11-11 18:26:13 -06:00
Caleb Cartwright 31cef56779 feat: add initial support for ConstBlock expressions 2020-10-24 11:13:00 -05:00
David Tolnay 8635a5ca44 deps: bump rustc-ap to v679 2020-09-23 00:45:18 -05:00
Caleb Cartwright e4617e0e61 deps: bump rustc-ap to v672 2020-09-04 19:01:18 -05:00
Caleb Cartwright b28fd5f91c deps: apply upstream rustc-* changes 2020-06-11 13:22:37 -05:00
Seiichi Uchida 577ef8136f Update rustc-ap-* crates to 659.0.0 for rustfmt-1.4.15 (#4184) 2020-05-19 17:31:28 +09:00
Caleb Cartwright c1267303bc fix: formatting arbitrary extern abi (#4089) 2020-03-31 15:30:26 +09:00
Caleb Cartwright ac2d5b85a5 deps: bump rustc-ap* to v651 2020-03-30 12:02:39 -05:00
Caleb Cartwright b173b42354 refactor: rename libsyntax --> rustc_ast 2020-03-27 22:29:12 -05:00
Caleb Cartwright 9b0ed57af6 refactor: parse & mod resolver for rustc-ap v650 2020-03-27 21:33:34 -05:00
Caleb Cartwright bd5dff4012 refactor: backport syntux mod 2020-03-26 21:25:34 -05:00
Caleb Cartwright 9699c96cf1 deps: bump to rustc v647 2020-03-26 17:20:24 -05:00
Caleb Cartwright 7a76ec062d deps: bump to rustc v644 2020-03-26 15:26:58 -05:00
Caleb Cartwright c60416ed21 deps: update rustc-ap to v642.0.0 2020-02-08 22:21:37 -06:00
Rui 69c7dbcd50 Try to solve issue3456. (#3556) 2019-10-19 18:19:47 +09:00
Stéphane Campinas 160c3aafc5 handle hard tabs when formatting trailing comments (#3836) 2019-10-07 16:40:27 +09:00