rust/tests
bors 8fe0c753f2 Auto merge of - tgross35:missing-fragment-specifier-e2024, r=petrochenkov
Make `missing_fragment_specifier` an error in edition 2024

`missing_fragment_specifier` has been a future compatibility warning since 2017. Uplifting it to an unconditional hard error was attempted in 2020, but eventually reverted due to fallout.

Make it an error only in edition >= 2024, leaving the lint for older editions. This change will make it easier to support more macro syntax that relies on usage of `$`.

Fixes <https://github.com/rust-lang/rust/issues/40107>

---

It is rather late for the edition but since this change is relatively small, it seems worth at least bringing up. This follows a brief [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/268952-edition/topic/.60.20DBD.20-.3E.20hard.20error) (cc `@tmandry).`

Making this an edition-dependent lint has come up before but there was not a strong motivation. I am proposing it at this time because this would simplify the [named macro capture groups](https://github.com/rust-lang/rfcs/pull/3649) RFC, which has had mildly positive response, and makes use of new `$` syntax in the matcher. The proposed syntax currently parses as metavariables without a fragment specifier; this warning is raised, but there are no errors.

It is obviously not known that this specific RFC will eventually be accepted, but forbidding `missing_fragment_specifier` should make it easier to support any new syntax in the future that makes use of `$` in different ways. The syntax conflict is also not impossible to overcome, but making it clear that unnamed metavariables are rejected makes things more straightforward and should allow for better diagnostics.

`@Mark-Simulacrum` suggested making this forbid-by-default instead of an error at https://github.com/rust-lang/rust/issues/40107#issuecomment-761727885, but I don't think this would allow the same level of syntax flexibility.

It is also possible to reconsider making this an unconditional error since four years have elapsed since the previous attempt, but this seems likely to hit the same pitfalls. (Possibly worth a crater run?)

Tracking:

- https://github.com/rust-lang/rust/issues/128143
2024-07-27 12:35:18 +00:00
..
assembly Auto merge of - saethlin:optimize-clone-shims, r=compiler-errors 2024-07-26 13:13:04 +00:00
auxiliary
codegen Auto merge of - reitermarkus:u32-from-char-opt, r=scottmcm 2024-07-27 09:34:26 +00:00
codegen-units
coverage Bless coverage. 2024-07-13 12:02:12 +00:00
coverage-run-rustdoc
crashes Rollup merge of - compiler-errors:misused-intrinsics, r=oli-obk 2024-07-25 16:48:22 +02:00
debuginfo
incremental
mir-opt Auto merge of - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors 2024-07-21 05:36:21 +00:00
pretty
run-make rewrite export-executable-symbols to rmake 2024-07-26 10:17:39 -04:00
run-pass-valgrind
rustdoc Auto merge of - compiler-errors:impl-sorting, r=lcnr 2024-07-21 22:43:47 +00:00
rustdoc-gui Add regression test for items list size () 2024-07-22 11:33:03 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
rustdoc-ui Rollup merge of - estebank:no-question, r=fmease 2024-07-25 04:43:20 +02:00
ui Make missing_fragment_specifier an error in edition 2024 2024-07-27 05:33:24 -04:00
ui-fulldeps Auto merge of - runtimeverification:smir_serde_derive, r=celinval 2024-07-25 20:27:51 +00:00
COMPILER_TESTS.md