rust/tests
bors 71b68da1bd Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu
Fix breakage when running compiletest with `--test-args=--edition=2015`

Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter.

This PR fixes the two categories of failures happening when `--edition=2015` is passed:

* Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error.
* Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation.

Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests.

I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed.

r? `@jieyouxu`
2025-04-11 10:53:45 +00:00
..
assembly Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
auxiliary
codegen Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
codegen-units
coverage Update the minimum external LLVM to 19 2025-04-05 11:44:38 -07:00
coverage-run-rustdoc Update coverage-run-rustdoc output 2025-03-28 10:35:53 +01:00
crashes Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
debuginfo replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
incremental replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
mir-opt Auto merge of #139088 - spastorino:ergonomic-ref-counting-2, r=nikomatsakis 2025-04-10 09:08:23 +00:00
pretty Avoid empty identifiers for delegate params and args. 2025-04-10 14:46:53 +10:00
run-make fix "still mutable" ice while metrics are enabled 2025-04-08 15:00:37 -07:00
rustdoc replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
rustdoc-gui Add regression test for #139282 2025-04-07 17:28:46 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json rustdoc-json: Add test for #[automatically_derived] attribute 2025-03-31 20:42:49 +00:00
rustdoc-ui Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
ui Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
ui-fulldeps Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-dead 2025-04-11 13:31:44 +10:00
COMPILER_TESTS.md