rust/compiler
Nicholas Nethercote 3e3a4192d8 Split MacArgs in two.
`MacArgs` is an enum with three variants: `Empty`, `Delimited`, and `Eq`. It's
used in two ways:
- For representing attribute macro arguments (e.g. in `AttrItem`), where all
  three variants are used.
- For representing function-like macros (e.g. in `MacCall` and `MacroDef`),
  where only the `Delimited` variant is used.

In other words, `MacArgs` is used in two quite different places due to them
having partial overlap. I find this makes the code hard to read. It also leads
to various unreachable code paths, and allows invalid values (such as
accidentally using `MacArgs::Empty` in a `MacCall`).

This commit splits `MacArgs` in two:
- `DelimArgs` is a new struct just for the "delimited arguments" case. It is
  now used in `MacCall` and `MacroDef`.
- `AttrArgs` is a renaming of the old `MacArgs` enum for the attribute macro
  case. Its `Delimited` variant now contains a `DelimArgs`.

Various other related things are renamed as well.

These changes make the code clearer, avoids several unreachable paths, and
disallows the invalid values.
2022-11-22 09:04:15 +11:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_ast_lowering Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_ast_passes
rustc_ast_pretty Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_attr
rustc_baked_icu_data Update crate documentation of rustc_baked_icu_data crate 2022-11-18 14:46:36 -08:00
rustc_borrowck Auto merge of #103491 - cjgillot:self-rpit, r=oli-obk 2022-11-21 12:17:03 +00:00
rustc_builtin_macros Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_codegen_cranelift Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3 2022-11-21 14:11:12 +01:00
rustc_codegen_gcc Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3 2022-11-19 11:54:43 +05:30
rustc_codegen_llvm Rollup merge of #104511 - dpaoliello:privateglobalworkaround, r=michaelwoerister 2022-11-21 14:11:10 +01:00
rustc_codegen_ssa Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3 2022-11-21 14:11:12 +01:00
rustc_const_eval Rollup merge of #104595 - compiler-errors:poly-existential-predicate, r=lcnr 2022-11-21 14:11:11 +01:00
rustc_data_structures Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser 2022-11-19 02:28:47 +00:00
rustc_driver Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk 2022-11-19 15:35:18 +01:00
rustc_error_codes Auto merge of #103491 - cjgillot:self-rpit, r=oli-obk 2022-11-21 12:17:03 +00:00
rustc_error_messages Rollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebank 2022-11-20 23:50:27 +01:00
rustc_errors Rollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebank 2022-11-20 23:50:27 +01:00
rustc_expand Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_feature Auto merge of #103491 - cjgillot:self-rpit, r=oli-obk 2022-11-21 12:17:03 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir Auto merge of #98914 - fee1-dead-contrib:min-deref-patterns, r=compiler-errors 2022-11-20 07:16:42 +00:00
rustc_hir_analysis Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr 2022-11-21 15:22:54 +00:00
rustc_hir_pretty
rustc_hir_typeck Rollup merge of #104595 - compiler-errors:poly-existential-predicate, r=lcnr 2022-11-21 14:11:11 +01:00
rustc_incremental
rustc_index
rustc_infer Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr 2022-11-21 15:22:54 +00:00
rustc_interface Enable icu sync feature for parallel compiler 2022-11-18 14:46:35 -08:00
rustc_lexer Use token::Lit in ast::ExprKind::Lit. 2022-11-16 09:41:28 +11:00
rustc_lint Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_lint_defs Merge branch 'master' into patch-2 2022-11-15 21:16:11 +01:00
rustc_llvm Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisa 2022-11-21 01:44:12 +00:00
rustc_log
rustc_macros couple of clippy::perf fixes 2022-11-18 10:30:47 +01:00
rustc_metadata Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_middle Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_mir_build Factor out conservative_is_privately_uninhabited 2022-11-20 19:04:11 -06:00
rustc_mir_dataflow couple of clippy::perf fixes 2022-11-18 10:30:47 +01:00
rustc_mir_transform Factor out conservative_is_privately_uninhabited 2022-11-20 19:04:11 -06:00
rustc_monomorphize Make "long type" printing type aware 2022-11-18 08:42:59 -08:00
rustc_parse Split MacArgs in two. 2022-11-22 09:04:15 +11:00
rustc_parse_format
rustc_passes Change to Ty::is_inhabited_from 2022-11-20 19:04:11 -06:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve Auto merge of #104573 - matthiaskrgr:rollup-k36ybtp, r=matthiaskrgr 2022-11-18 20:26:58 +00:00
rustc_save_analysis
rustc_serialize
rustc_session track_errors use a delay_span_bug 2022-11-18 13:25:17 +00:00
rustc_smir
rustc_span Auto merge of #103491 - cjgillot:self-rpit, r=oli-obk 2022-11-21 12:17:03 +00:00
rustc_symbol_mangling drive-by: PolyExistentialPredicate 2022-11-19 04:04:27 +00:00
rustc_target Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3 2022-11-19 11:54:43 +05:30
rustc_trait_selection Rollup merge of #104595 - compiler-errors:poly-existential-predicate, r=lcnr 2022-11-21 14:11:11 +01:00
rustc_traits Rollup merge of #104595 - compiler-errors:poly-existential-predicate, r=lcnr 2022-11-21 14:11:11 +01:00
rustc_transmute
rustc_ty_utils Auto merge of #103491 - cjgillot:self-rpit, r=oli-obk 2022-11-21 12:17:03 +00:00
rustc_type_ir