rust/tests/ui/higher-ranked
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
..
leak-check Report higher-ranked trait error when higher-ranked projection goal fails in new solver 2025-04-09 17:53:32 +00:00
subtype [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
trait-bounds replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
anonymous-higher-ranked-lifetime.rs Adjust anonymous-higher-ranked-lifetime.rs 2024-12-10 11:31:13 +08:00
anonymous-higher-ranked-lifetime.stderr Adjust anonymous-higher-ranked-lifetime.rs 2024-12-10 11:31:13 +08:00
builtin-closure-like-bounds.rs Stabilize the 2024 edition 2024-11-22 11:12:15 -08:00
closure-bound-codegen-ice.rs Fix obligation param and bless tests 2024-04-01 22:48:23 -04:00
erroneous-lifetime-bound.rs Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00
erroneous-lifetime-bound.stderr Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00
higher-lifetime-bounds.rs Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
higher-lifetime-bounds.stderr Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
higher-ranked-lifetime-equality.rs Make nll higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:59 -03:00
higher-ranked-lifetime-equality.stderr Make nll higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:59 -03:00
higher-ranked-lifetime-error.rs eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
higher-ranked-lifetime-error.stderr eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
structually-relate-aliases.rs Assert that obligations are empty before deeply normalizing 2024-12-02 22:51:18 +00:00
structually-relate-aliases.stderr Use trait name instead of full constraint in suggestion message 2024-12-07 21:29:58 +00:00
subtyping-fn-ptr-coercion.rs Use the right type when coercing fn items to pointers 2024-08-13 16:23:20 -04:00
well-formed-aliases.rs Okay actually check only alias TYPES 2024-05-21 15:56:10 -04:00
well-formed-aliases.stderr Okay actually check only alias TYPES 2024-05-21 15:56:10 -04:00