rust/tests
Josh Triplett 6c04e0a7ae Rewrite macro_rules! parser to not use the MBE engine itself
The `macro_rules!` parser was written to match the series of rules using
the macros-by-example (MBE) engine and a hand-written equivalent of the
left-hand side of a MBE macro. This was complex to read, difficult to
extend, and produced confusing error messages. Because it was using the
MBE engine, any parse failure would be reported as if some macro was
being applied to the `macro_rules!` invocation itself; for instance,
errors would talk about "macro invocation", "macro arguments", and
"macro call", when they were actually about the macro *definition*.

And in practice, the `macro_rules!` parser only used the MBE engine to
extract the left-hand side and right-hand side of each rule as a token
tree, and then parsed the rest using a separate parser.

Rewrite it to parse the series of rules using a simple loop, instead.
This makes it more extensible in the future, and improves error
messages. For instance, omitting a semicolon between rules will result
in "expected `;`" and "unexpected token", rather than the confusing "no
rules expected this token in macro call".

This work was greatly aided by pair programming with Vincenzo Palazzo
and Eric Holk.
2025-06-26 15:20:42 -07:00
..
assembly tests: s/C-cmse/cmse/ 2025-06-25 00:52:10 -07:00
auxiliary tests: Adopt ABI transmute tests from crashtests 2025-06-23 09:40:00 -07:00
codegen Rollup merge of #142768 - scottmcm:avoid-unneeded-bitcast, r=WaffleLapkin 2025-06-24 19:45:31 -07:00
codegen-units Fix tests to drop now-skipped codegen 2025-06-22 12:03:42 -04:00
coverage coverage: Revert "unused local file IDs" due to empty function names 2025-05-27 23:33:29 +10:00
coverage-run-rustdoc
crashes Rollup merge of #142976 - compiler-errors:coerce-ice, r=fee1-dead 2025-06-25 22:14:56 +02:00
debuginfo tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
incremental compiletest: Improve diagnostics for line annotation mismatches 2025-06-23 21:30:56 +03:00
mir-opt Rollup merge of #142571 - cjgillot:borrowed-classes, r=oli-obk 2025-06-20 23:25:55 -04:00
pretty Move the place in &pin mut $place when !Unpin to ensure soundness 2025-06-15 10:31:11 +08:00
run-make Rollup merge of #142955 - bjorn3:cg_clif_test_fixes, r=jieyouxu 2025-06-24 19:45:34 -07:00
rustdoc rustdoc: Don't mark #[target_feature] functions as ⚠ 2025-06-24 18:55:45 +00:00
rustdoc-gui rustdoc: make srcIndex no longer a global variable 2025-06-16 20:22:24 -05:00
rustdoc-js Migrate some tests away from concat-idents 2025-06-24 10:54:54 +00:00
rustdoc-js-std add doc(alias("AsciiChar")) to core::ascii::Char 2025-06-20 11:11:51 -05:00
rustdoc-json Rollup merge of #142919 - aDotInTheVoid:cold-cold-attr-for-you, r=GuillaumeGomez 2025-06-24 15:39:41 +02:00
rustdoc-ui rustdoc: {Meta,Pointee,}Sized in non-minicore 2025-06-16 23:04:36 +00:00
ui Rewrite macro_rules! parser to not use the MBE engine itself 2025-06-26 15:20:42 -07:00
ui-fulldeps rustc_session: Add a structure for keeping both explicit and default sysroots 2025-06-24 16:00:04 +03:00
COMPILER_TESTS.md