rust/src
bors 5085bf51dd Auto merge of #119163 - fmease:refactor-ast-trait-bound-modifiers, r=compiler-errors
Refactor AST trait bound modifiers

Instead of having two types to represent trait bound modifiers in the parser / the AST (`parser::ty::BoundModifiers` & `ast::TraitBoundModifier`), only to map one to the other later, just use `parser::ty::BoundModifiers` (moved & renamed to `ast::TraitBoundModifiers`).

The struct type is more extensible and easier to deal with (see [here](https://github.com/rust-lang/rust/pull/119099/files#r1430749981) and [here](https://github.com/rust-lang/rust/pull/119099/files#r1430752116) for context) since it more closely models what it represents: A compound of two kinds of modifiers, constness and polarity. Modeling this as an enum (the now removed `ast::TraitBoundModifier`) meant one had to add a new variant per *combination* of modifier kind, which simply isn't scalable and which lead to a lot of explicit non-DRY matches.

NB: `hir::TraitBoundModifier` being an enum is fine since HIR doesn't need to worry representing invalid modifier kind combinations as those get rejected during AST validation thereby immensely cutting down the number of possibilities.
2023-12-22 02:00:55 +00:00
..
attr Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
bin Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
cargo-fmt Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
config remove redundant imports 2023-12-10 10:56:22 +08:00
emitter remove redundant imports 2023-12-10 10:56:22 +08:00
format-diff Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
formatting Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree 2021-10-20 00:11:59 -05:00
git-rustfmt Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
modules Rename ast::Lit as ast::MetaItemLit. 2022-11-28 15:18:49 +11:00
parse Rename many DiagCtxt and EarlyDiagCtxt locals. 2023-12-18 16:06:22 +11:00
test Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
attr.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
chains.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
closures.rs Make some matches exhaustive to avoid bugs, fix tools 2023-12-08 17:23:26 +00:00
comment.rs remove redundant imports 2023-12-10 10:56:22 +08:00
coverage.rs Implement closing-block procedure without relying on missed_span module (#3691) 2019-07-17 23:07:12 +09:00
emitter.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
expr.rs coro_kind -> coroutine_kind 2023-12-08 17:23:25 +00:00
format_report_formatter.rs Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rustfmt 2022-06-12 22:03:05 -05:00
formatting.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
ignore_path.rs remove redundant imports 2023-12-10 10:56:22 +08:00
imports.rs remove redundant imports 2023-12-10 10:56:22 +08:00
items.rs Give VariantData::Struct named fields, to clairfy recovered. 2023-12-20 00:07:34 +00:00
lib.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
lists.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
macros.rs Add spacing information to delimiters. 2023-12-11 09:36:40 +11:00
matches.rs Parse a pattern with no arm 2023-12-03 12:25:46 +01:00
missed_spans.rs Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree 2021-10-20 00:11:59 -05:00
modules.rs Use ThinVec in a few more AST types. 2023-02-21 11:51:56 +11:00
overflow.rs Merge commit '3f7c366fc0464e01ddcaefbd70647cb3da4202be' into rustfmt-sync 2023-06-19 23:13:56 -05:00
pairs.rs Rework ast::BinOpKind::to_string and ast::UnOp::to_string. 2023-11-28 09:42:07 +11:00
patterns.rs Add never_patterns feature gate 2023-11-29 03:58:29 +01:00
release_channel.rs Move macro to separate module 2019-05-17 16:13:46 +02:00
reorder.rs remove redundant imports 2023-12-10 10:56:22 +08:00
rewrite.rs Merge commit 'c4416f20dcaec5d93077f72470e83e150fb923b1' into sync-rustfmt 2022-06-22 22:14:32 -05:00
rustfmt_diff.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
shape.rs Merge commit 'c4416f20dcaec5d93077f72470e83e150fb923b1' into sync-rustfmt 2022-06-22 22:14:32 -05:00
skip.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
source_file.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
source_map.rs refactor: backport syntux mod 2020-03-26 21:25:34 -05:00
spanned.rs Parse a pattern with no arm 2023-12-03 12:25:46 +01:00
stmt.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
string.rs Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
syntux.rs refactor: backport syntux mod 2020-03-26 21:25:34 -05:00
types.rs Refactor AST trait bound modifiers 2023-12-20 19:39:46 +01:00
utils.rs Make some matches exhaustive to avoid bugs, fix tools 2023-12-08 17:23:26 +00:00
vertical.rs Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree 2022-03-29 23:17:30 -05:00
visitor.rs Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt 2023-01-24 14:16:03 -06:00