rust/tests/ui/traits/next-solver
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
..
alias-relate Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
assembly Add some new solver tests 2024-03-08 15:54:04 +00:00
canonical Manually walk into WF obligations in BestObligation proof tree visitor 2025-01-31 18:21:58 +00:00
coherence change definitely non-productive cycles to error 2025-03-05 10:06:43 +01:00
cycles keep inductive cycles as ambig in coherence 2025-03-05 10:06:43 +01:00
diagnostics UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
generalize resolve FIXME 2024-12-18 16:35:06 +01:00
method eagerly prove WF when resolving fully qualified paths 2025-02-14 00:04:22 +01:00
normalization-shadowing handle global trait bounds defining assoc type 2025-01-20 18:51:45 +01:00
normalize remove feature(trait_upcasting) from tests and bless them 2025-02-06 23:44:23 +01:00
opaques replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
overflow Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
typeck Auto merge of #133559 - compiler-errors:structurally-resolve-adjust-for-branch, r=lcnr 2024-12-06 04:55:35 +00:00
alias-bound-preference.rs
alias-bound-unsound.rs Bless tests due to extra error reporting due to normalizing types that are not WF 2024-11-27 03:34:58 +00:00
alias-bound-unsound.stderr Bless tests due to extra error reporting due to normalizing types that are not WF 2024-11-27 03:34:58 +00:00
alias-eq-in-canonical-response.rs
alias-sub.rs
ambiguous-impl-in-resolve.rs Don't ICE when codegen_select returns ambiguity in new solver 2024-04-25 11:49:12 -04:00
array-default.rs
async.fail.stderr Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
async.rs Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
auto-with-drop_tracking_mir.fail.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
auto-with-drop_tracking_mir.rs Use a proof tree visitor to refine the Obligation for error reporting 2024-05-02 21:56:14 -04:00
borrowck-error.rs
borrowck-error.stderr
builtin-fn-must-return-sized.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
builtin-fn-must-return-sized.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
cast-checks-handling-projections.rs
closure-inference-guidance.rs
closure-signature-inference-2.rs
closure-signature-inference-hr-ambig-alias-naming-self.rs "normalize" signature before checking mentions self 2025-01-28 14:11:29 +00:00
closure-signature-inference.rs
closure-substs-ambiguity.rs
coerce-ambig-alias-to-rigid-alias.rs
const-param-placeholder.fail.stderr
const-param-placeholder.rs
constrain-alias-goals-in-unsize.rs Process alias-relate obligations in CoerceUnsized loop 2024-02-27 20:07:58 +00:00
coroutine.fail.stderr Be better at reporting alias errors 2024-10-15 20:42:17 -04:00
coroutine.rs fix tests 2024-11-02 16:58:50 +00:00
deduce-ty-from-object.rs
dedup-regions.rs
destruct.rs Gate const drop behind const_destruct feature, and fix const_precise_live_drops post-drop-elaboration check 2024-11-22 16:54:40 +00:00
dont-canonicalize-re-error.rs Uniquify ReError on input mode in canonicalizer 2024-03-22 16:35:50 -04:00
dont-canonicalize-re-error.stderr Uniquify ReError on input mode in canonicalizer 2024-03-22 16:35:50 -04:00
dont-coerce-infer-to-dyn.rs
dont-elaborate-for-projections.rs
dont-ice-on-assoc-projection.rs
dont-ice-on-assoc-projection.stderr
dont-ice-on-bad-transmute-in-typeck.rs Don't ice on bad transmute in typeck in new solver 2025-01-06 17:56:16 +00:00
dont-ice-on-bad-transmute-in-typeck.stderr Don't ice on bad transmute in typeck in new solver 2025-01-06 17:56:16 +00:00
dont-loop-fulfill-on-region-constraints.rs
dont-normalize-proj-with-error.rs
dont-normalize-proj-with-error.stderr
dyn-any-dont-prefer-impl.rs change selection test to run-pass 2024-05-28 04:44:45 +00:00
dyn-incompatibility.rs Register a dummy candidate for failed structural normalization during candiate assembly 2024-10-15 20:42:17 -04:00
dyn-incompatibility.stderr Use trait name instead of full constraint in suggestion message 2024-12-07 21:29:58 +00:00
elaborate-item-bounds.rs
escaping-bound-vars-in-writeback-normalization.rs
float-canonical.rs
fn-trait-closure.rs
fn-trait.rs Check that alias-relate terms are WF if reporting an error in alias-relate 2024-06-13 08:52:35 -04:00
fn-trait.stderr Be better at reporting alias errors 2024-10-15 20:42:17 -04:00
gat-wf.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
gat-wf.stderr Deeply normalize associated type bounds before proving them 2025-02-17 17:21:24 +00:00
global-cache-and-parallel-frontend.rs compiler: Inform the solver of concurrency 2024-09-09 13:07:48 -07:00
global-cache-and-parallel-frontend.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
higher-ranked-dyn-bounds.rs
int-var-alias-eq.rs
int-var-is-send.rs
issue-118950-root-region.rs Assert that obligations are empty before deeply normalizing 2024-12-02 22:51:18 +00:00
issue-118950-root-region.stderr Mention type parameter in more cases and don't suggest ~const bound already there 2024-12-07 21:37:13 +00:00
iter-filter-projection.rs
known-type-outlives-has-constraints.rs Make sure to scrape region constraints from deeply normalizing type outlives assumptions in borrowck 2025-01-14 19:13:18 +00:00
lazy-nested-obligations-1.rs
lazy-nested-obligations-2.rs
lazy-nested-obligations-3.rs
more-object-bound.rs Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
more-object-bound.stderr Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
nested-alias-bound.rs
nested-obligations-with-bound-vars-gat.rs
non-wf-in-coerce-pointers.rs Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver 2025-01-22 19:13:52 +00:00
non-wf-in-coerce-pointers.stderr Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver 2025-01-22 19:13:52 +00:00
non-wf-ret.rs Check xform_ret_ty for WF in the new solver to improve method winnowing 2024-11-27 20:46:08 +00:00
normalize-in-implied_outlives_bounds.rs Deeply normalize when computing implied outlives bounds 2024-12-02 22:51:17 +00:00
object-soundness-requires-generalization.rs
opportunistic-region-resolve.rs
param-discr-kind.rs
pointee.rs
pointer-like.rs
pointer-like.stderr
prefer-candidate-no-constraints.rs
prefer-param-env-on-ambiguity.rs
projection-discr-kind.rs
projection-discr-kind.stderr
slice-match-byte-lit.rs
specialization-transmute.rs Pass spans around new solver 2025-02-05 18:32:06 +00:00
specialization-transmute.stderr Pass spans around new solver 2025-02-05 18:32:06 +00:00
specialization-unconstrained.rs Also passthrough for projection clauses 2024-06-12 19:10:02 -04:00
specialization-unconstrained.stderr Also passthrough for projection clauses 2024-06-12 19:10:02 -04:00
stall-num-var-auto-trait.fallback.stderr
stall-num-var-auto-trait.rs
structural-resolve-field.rs
structurally-normalize-in-borrowck-field-projection.rs Structurally resolve before applying projection in borrowck 2024-11-27 20:39:49 +00:00
trait-upcast-lhs-needs-normalization.rs remove feature(trait_upcasting) from tests and bless them 2025-02-06 23:44:23 +01:00
try-example.rs
unevaluated-const-impl-trait-ref.fails.stderr Spell out other trait diagnostic 2024-06-12 12:34:47 +00:00
unevaluated-const-impl-trait-ref.rs
unsafe-auto-trait-impl.rs
unsize-although-ambiguous.rs
unsize-good.rs Delete tuple unsizing 2025-02-27 10:26:33 +00:00
unsound-region-obligation.rs Pass spans around new solver 2025-02-05 18:32:06 +00:00
unsound-region-obligation.stderr Pass spans around new solver 2025-02-05 18:32:06 +00:00
upcast-right-substs.rs remove feature(trait_upcasting) from tests and bless them 2025-02-06 23:44:23 +01:00
upcast-wrong-substs.rs
upcast-wrong-substs.stderr
well-formed-in-relate.rs Allow WellFormed goals to be returned from relating in new solver 2025-03-24 16:57:06 +00:00
well-formed-in-relate.stderr Allow WellFormed goals to be returned from relating in new solver 2025-03-24 16:57:06 +00:00
winnow-specializing-impls.rs