111 Commits

Author SHA1 Message Date
Zalathar edbb86264d Add support for cpass incremental revisions 2026-04-22 12:34:14 +10:00
Zalathar 0ea8958c02 Migrate bfail/build-pass tests to bpass (2/2)
This is the subset of incremental tests that have a FIXME to consider migrating
to check-pass instead.

That migration is beyond the scope of this PR, but might be attempted later.
2026-04-22 12:28:25 +10:00
Zalathar 793c646b7b Migrate bfail/build-pass tests to bpass (1/2)
This is the subset of incremental tests that should continue to use `bpass`
even after `cpass` is supported, because they (presumably) involve codegen.
2026-04-22 12:28:25 +10:00
Zalathar 72abf370bb Rename incremental cfail/cpass revisions to bfail/bpass
Long ago, UI tests were divided into "compile" and "run" tests. Later, the
compile tests were further subdivided into "check" and "build" tests, to speed
up tests that don't need a full build.

The same split was never applied to incremental test revisions, so the only way
to perform a check build in incremental tests is (confusingly) to use a `cfail`
revision and then specify `//@ check-fail` or `//@ check-pass`.

This PR makes room for dedicated check-fail and check-pass revisions by
renaming the existing `cfail` and `cpass` revisions to `bfail` and `bpass`,
since they currently perform a full build.
2026-04-18 18:13:17 +10:00
Jonathan Brouwer 5c7384e1c9 Add regression test 2026-04-17 16:08:45 +02:00
Zalathar 975402e329 Remove the //@ should-ice directive
This directive was only being used by one test, which can just as easily use
the more general `//@ failure-status` directive instead.

All of the removed exit-code checks were redundant with other exit-code checks
that are still present.
2026-04-17 13:43:50 +10:00
Zalathar c79fcfcca8 Fix some irrelevant warnings in tests/incremental
This avoids having to add several unhelpful annotations when enabling
diagnostic checks for `cpass` and `rpass` revisions.
2026-04-13 20:48:07 +10:00
Jonathan Brouwer ea86990ee6 Regression test for issue 154878
Co-authored-by: Edvin Bryntesson <epost@edvinbryntesson.se>
2026-04-09 20:34:37 +02:00
Zalathar a5181d2fd6 Remove rfail support from incremental tests
Incremental revisions beginning with `rfail` would cause the incremental test
runner to build the test program, expecting success, and then run the test
program, expecting failure.

Expecting incremental tests to fail at runtime is of questionable utility,
because in almost all cases an equivalent test program can be made to succeed
at runtime instead.

Removing `rfail` support is a small step towards cleaning up compiletest's
incremental test runner, and its overall handling of pass/fail expectations.

There was one existing regression test using `rfail` revisions:
`tests/incremental/issue-80691-bad-eval-cache.rs`. The test code is complex,
and reverting the fix in RUST-83220 does not actually cause the test to fail,
suggesting that it is no longer a useful regression test. This commit therefore
deletes that test.
2026-04-04 13:31:31 +11:00
bors 009a6c1e8b Auto merge of #154308 - ShoyuVanilla:undo-fudge-iv, r=jieyouxu
Revert #151380 and #153869

cc https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports/topic/.23153869.3A.20beta-nominated/with/581306395

r? ghost
2026-04-02 00:09:59 +00:00
Daria Sukhonina 1792232d01 fix tests/incremental/hashes 2026-03-28 12:38:49 +03:00
Daria Sukhonina 5cf7376aac Rename typeck into typeck_root in tests/incremental 2026-03-28 12:38:49 +03:00
Shoyu Vanilla d5bbeb978e Revert "Auto merge of #151380 - ShoyuVanilla:shallow-resolve-to-root-var, r=lcnr"
This reverts commit 75b9d89c68, reversing
changes made to 7bee525095.
2026-03-24 22:31:37 +09:00
John Kåre Alsaker fed57899b9 Remove value_from_cycle_error specialization for type_of 2026-03-13 18:52:26 +01:00
mu001999 0436634084 Remove unused features in tests 2026-03-04 08:06:45 +08:00
mu001999 28b6bcb42d Add tests for unused-features 2026-03-02 09:38:04 +08:00
mejrs cfc2468969 Port rustc_on_unimplemented attribute 2026-02-24 10:50:38 +01:00
Camille Gillot a182053fa0 Bless incremental. 2026-02-22 19:43:57 +00:00
Shoyu Vanilla 8062bee9e3 Bless tests 2026-02-11 18:08:18 +09:00
Jamie Hill-Daniel 94a0ba50e1 Port rustc_clean to attribute parser
Also remove mentions of removed `rustc_dirty`
2026-02-04 20:58:02 +00:00
Felix Rath 8fa2f693bb Implement incremental caching for derive macro expansions 2026-01-16 07:36:36 +01:00
mu001999 6c2dc40666 Bless other tests 2026-01-07 09:33:40 +08:00
Jonathan Brouwer 1d204fcf1d Add unsafe to no_mangle incremental tests 2025-12-03 17:00:22 +01:00
Mara Bos 7b42543f81 Bless tests. 2025-11-12 12:48:27 +01:00
Romain Perier c8c04663c5 Add a note when a type implements a trait with the same name as the required one
This is useful when you have two dependencies that use different trait for
the same thing and with the same name. The user can accidentally implement
the bad one which might be confusing. This commits refactorizes existing
diagnostics about multiple different crates with the same version and adds
a note when similarly named traits are found. All diagnostics are merged
into a single one.
2025-11-11 17:36:43 +01:00
Ben Kimock 775da711c6 Add a fast path for lowering trivial consts 2025-10-25 16:59:53 -04:00
Guillaume Gomez 5ff7ca2e22 Ignore failing incremental tests for GCC backend 2025-10-13 15:20:49 +02:00
Camille GILLOT 27127e342d Bless incremental tests. 2025-07-13 13:50:01 +00:00
Oli Scherer 38ef94aef1 Stop requiring HIR for trait item wf checks 2025-06-30 08:45:43 +00:00
Oli Scherer cb158c2119 Merge lower_item into check_item_type 2025-06-30 08:45:43 +00:00
Oli Scherer 9b5d57d0a9 Unconditionally run check_item_type on all items 2025-06-30 08:06:08 +00:00
Vadim Petrochenkov 7a4f09c224 compiletest: Improve diagnostics for line annotation mismatches 2025-06-23 21:30:56 +03:00
Trevor Gross c93fac7d64 Rollup merge of #142485 - mu001999-contrib:dead-code/adt-pattern, r=petrochenkov
Marks ADT live if it appears in pattern

Marks ADT live if it appears in pattern, it implies the construction of the ADT.
1. Then we can detect unused private ADTs impl `Default`, without special logics for `Default` and other std traits.
2. We can also remove `rustc_trivial_field_reads` on `Default`, and the logic in `should_ignore_item` (introduced by rust-lang/rust#126302).

Fixes rust-lang/rust#120770

Extracted from rust-lang/rust#128637.
r? `@petrochenkov`
2025-06-20 23:25:55 -04:00
David Wood 183458263b tests: bless remaining tests
These tests just need blessing, they don't have any interesting behaviour
changes.

Some of these tests have new errors because `LegacyReceiver` cannot be
proven to be implemented now that it is also testing for `MetaSized` -
but this is just a consequence of the other errors in the test.
2025-06-16 23:04:35 +00:00
Mu001999 52167e04e6 Marks ADT live if it appears in pattern 2025-06-14 13:44:43 +08:00
Jubilee Young 643a9d233b tests: Change "fastcall" to "system" in some tests
Lets the test still work on different architectures.
2025-06-09 16:10:21 -07:00
Michael Goulet f7db329e81 Add a test to reproduce ICE 2025-06-03 20:56:45 +00:00
Michael Goulet df47958894 Remove manual WF hack 2025-05-07 16:29:59 +00:00
Vadim Petrochenkov 56d6b4e427 compiletest: Support matching on non-json lines in compiler output
and migrate most of remaining `error-pattern`s to it.
2025-05-04 18:27:45 +03:00
Vadim Petrochenkov 879b12e2ce compiletest: Do not require annotations on empty labels and suggestions 2025-05-03 22:49:23 +03:00
Vadim Petrochenkov 93bee0789a UI tests: migrate remaining compile time error-patterns to line annotations
when possible.
2025-04-13 21:48:53 +03:00
Pietro Albini cd371b90e2 replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
Vadim Petrochenkov fd854a772e compiletest: Avoid ignoring empty diagnostics in one more place
This catches some silly notes emitted by rustc, which should ideally be fixed
2025-04-07 19:43:41 +03:00
Matthias Krüger b17948ad52 Rollup merge of #139153 - compiler-errors:incr-comp-closure, r=oli-obk
Encode synthetic by-move coroutine body with a different `DefPathData`

See the included test. In the first revision rpass1, we have an async closure `{closure#0}` which has a coroutine as a child `{closure#0}::{closure#0}`. We synthesize a by-move coroutine body, which is `{closure#0}::{closure#1}` which depends on the mir_built query, which depends on the typeck query.

In the second revision rpass2, we've replaced the coroutine-closure by a closure with two children closure. Notably, the def path of the second child closure is the same as the synthetic def id from the last revision: `{closure#0}::{closure#1}`. When type-checking this closure, we end up trying to compute its def_span, which tries to fetch it from the incremental cache; this will try to force the dependencies from the last run, which ends up forcing the mir_built query, which ends up forcing the typeck query, which ends up with a query cycle.

The problem here is that we really should never have used the same `DefPathData` for the synthetic by-move coroutine body, since it's not a closure. Changing the `DefPathData` will mean that we can see that the def ids are distinct, which means we won't try to look up the closure's def span from the incremental cache, which will properly skip replaying the node's dependencies and avoid a query cycle.

Fixes #139142
2025-03-31 14:36:22 +02:00
Michael Goulet 897acc3e5d Encode synthetic by-move coroutine body with a different DefPathData 2025-03-30 22:53:21 +00:00
Vadim Petrochenkov 2dfd2a2a24 Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
Stuart Cook c45986ae61 Rollup merge of #130883 - madsmtm:env-var-query, r=petrochenkov
Add environment variable query

Generally, `rustc` prefers command-line arguments, but in some cases, an environment variable really is the most sensible option. We should make sure that this works properly with the compiler's change-tracking mechanisms, such that changing the relevant environment variable causes a rebuild.

This PR is a first step forwards in doing that.

Part of the work needed to do https://github.com/rust-lang/rust/issues/118204, see https://github.com/rust-lang/rust/pull/129342 for some discussion.

r? ``@petrochenkov``
2025-03-27 15:57:21 +11:00
Mads Marquart c772573708 Test that env! works with incremental compilation
This currently works because it's part of expansion, and that isn't yet
tracked by the query system. But we want to ensure it continues working,
even if that is changed.
2025-03-26 14:28:10 +01:00
Michael Goulet 4b22ac5296 Ensure define_opaque is accounted for in HIR hash 2025-03-26 00:15:34 +00:00
Folkert de Vries d8a067b931 remove most simd_ intrinsic declaration in tests
instead, we can just import the intrinsics from core
2025-02-27 12:22:59 +01:00