rust/tests
Matthias Krüger 3bd84f18bc
Rollup merge of #126700 - compiler-errors:fragment, r=fmease
Make edition dependent `:expr` macro fragment act like the edition-dependent `:pat` fragment does

Parse the `:expr` fragment as `:expr_2021` in editions <=2021, and as `:expr` in edition 2024. This is similar to how we parse `:pat` as `:pat_param` in edition <=2018 and `:pat_with_or` in >=2021, and means we can get rid of a span dependency from `nonterminal_may_begin_with`.

Specifically, this fixes a theoretical regression since the `expr_2021` macro fragment previously would allow `const {}` if the *caller* is edition 2024. This is inconsistent with the way that the `pat` macro fragment was upgraded, and also leads to surprising behavior when a macro *caller* crate upgrades to edtion 2024, since they may have parsing changes that they never asked for (with no way of opting out of it).

This PR also allows using `expr_2021` in all editions. Why was this was disallowed in the first place? It's purely additive, and also it's still feature gated?

r? ```@fmease``` ```@eholk``` cc ```@vincenzopalazzo```
cc #123865

Tracking:

- https://github.com/rust-lang/rust/issues/123742
2024-06-21 09:12:36 +02:00
..
assembly Auto merge of #126736 - matthiaskrgr:rollup-rb20oe3, r=matthiaskrgr 2024-06-20 13:36:42 +00:00
auxiliary Clean up users of rust_dbg_call 2024-04-17 15:08:08 -04:00
codegen Auto merge of #126578 - scottmcm:inlining-bonuses-too, r=davidtwco 2024-06-21 02:06:27 +00:00
codegen-units Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
coverage Auto merge of #116088 - nbdd0121:unwind, r=Amanieu,RalfJung 2024-06-20 11:22:59 +00:00
coverage-run-rustdoc [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
crashes Auto merge of #126578 - scottmcm:inlining-bonuses-too, r=davidtwco 2024-06-21 02:06:27 +00:00
debuginfo Add debuginfo tests for collapse_debuginfo for statics. 2024-06-13 16:04:31 +02:00
incremental Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoerister 2024-06-20 09:06:16 +00:00
mir-opt Auto merge of #126578 - scottmcm:inlining-bonuses-too, r=davidtwco 2024-06-21 02:06:27 +00:00
pretty Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errors 2024-06-07 09:08:59 +00:00
run-make Auto merge of #126745 - matthiaskrgr:rollup-xagplef, r=matthiaskrgr 2024-06-20 18:21:01 +00:00
run-pass-valgrind rustfmt tests/run-pass-valgrind/. 2024-06-04 09:53:02 +10:00
rustdoc Update code format and tests 2024-06-04 13:49:39 +02:00
rustdoc-gui Remove failing GUI test to stop blocking CI until it is fixed 2024-06-14 00:49:05 +02:00
rustdoc-js rustdoc-search: use lowercase, non-normalized name for type search 2024-06-09 11:56:52 -07:00
rustdoc-js-std Update tests 2024-06-07 11:55:52 +08:00
rustdoc-json rustfmt tests/rustdoc-json/. 2024-06-04 14:15:19 +10:00
rustdoc-ui Suggest standalone doctest for non-local impl defs 2024-06-15 13:00:53 +02:00
ui Rollup merge of #126700 - compiler-errors:fragment, r=fmease 2024-06-21 09:12:36 +02:00
ui-fulldeps Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
COMPILER_TESTS.md