about summary refs log tree commit diff
path: root/tests/incremental
AgeCommit message (Collapse)AuthorLines
2025-07-13Bless incremental tests.Camille GILLOT-3/+3
2025-06-30Stop requiring HIR for trait item wf checksOli Scherer-1/+1
2025-06-30Merge `lower_item` into `check_item_type`Oli Scherer-1/+1
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-1/+1
2025-06-23compiletest: Improve diagnostics for line annotation mismatchesVadim Petrochenkov-1/+1
2025-06-20Rollup merge of #142485 - mu001999-contrib:dead-code/adt-pattern, r=petrochenkovTrevor Gross-0/+2
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-16tests: bless remaining testsDavid Wood-7/+7
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-14Marks ADT live if it appears in patternMu001999-0/+2
2025-06-09tests: Change "fastcall" to "system" in some testsJubilee Young-2/+2
Lets the test still work on different architectures.
2025-06-03Add a test to reproduce ICEMichael Goulet-0/+25
2025-05-07Remove manual WF hackMichael Goulet-2/+4
2025-05-04compiletest: Support matching on non-json lines in compiler outputVadim Petrochenkov-4/+11
and migrate most of remaining `error-pattern`s to it.
2025-05-03compiletest: Do not require annotations on empty labels and suggestionsVadim Petrochenkov-1/+0
2025-04-13UI tests: migrate remaining compile time `error-pattern`s to line annotationsVadim Petrochenkov-4/+7
when possible.
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-2/+3
2025-04-07compiletest: Avoid ignoring empty diagnostics in one more placeVadim Petrochenkov-0/+1
This catches some silly notes emitted by rustc, which should ideally be fixed
2025-03-31Rollup merge of #139153 - compiler-errors:incr-comp-closure, r=oli-obkMatthias Krüger-0/+15
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-30Encode synthetic by-move coroutine body with a different DefPathDataMichael Goulet-0/+15
2025-03-30Remove attribute `#[rustc_error]`Vadim Petrochenkov-2/+2
2025-03-27Rollup merge of #130883 - madsmtm:env-var-query, r=petrochenkovStuart Cook-0/+36
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-26Test that env! works with incremental compilationMads Marquart-0/+36
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-26Ensure define_opaque is accounted for in HIR hashMichael Goulet-0/+19
2025-02-27remove most `simd_` intrinsic declaration in testsFolkert de Vries-5/+3
instead, we can just import the intrinsics from core
2025-02-09tests: error strings for ABI stability now matchJubilee Young-1/+1
2025-01-15add test for issue 135514Rémy Rakic-0/+40
2024-12-07Add more info on type/trait mismatches for different crate versionsEsteban Küber-8/+8
When encountering a type or trait mismatch for two types coming from two different crates with the same name, detect if it is either mixing two types/traits from the same crate on different versions: ``` error[E0308]: mismatched types --> replaced | LL | do_something_type(Type); | ----------------- ^^^^ expected `dependency::Type`, found `dep_2_reexport::Type` | | | arguments to this function are incorrect | note: two different versions of crate `dependency` are being used; two types coming from two different versions of the same crate are different types even if they look the same --> replaced | LL | pub struct Type(pub i32); | ^^^^^^^^^^^^^^^ this is the expected type `dependency::Type` | ::: replaced | LL | pub struct Type; | ^^^^^^^^^^^^^^^ this is the found type `dep_2_reexport::Type` | ::: replaced | LL | extern crate dep_2_reexport; | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` LL | extern crate dependency; | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate = help: you can use `cargo tree` to explore your dependency tree note: function defined here --> replaced | LL | pub fn do_something_type(_: Type) {} | ^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> replaced | LL | do_something_trait(Box::new(Type) as Box<dyn Trait2>); | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `dependency::Trait2`, found trait `dep_2_reexport::Trait2` | | | arguments to this function are incorrect | note: two different versions of crate `dependency` are being used; two types coming from two different versions of the same crate are different types even if they look the same --> replaced | LL | pub trait Trait2 {} | ^^^^^^^^^^^^^^^^ this is the expected trait `dependency::Trait2` | ::: replaced | LL | pub trait Trait2 {} | ^^^^^^^^^^^^^^^^ this is the found trait `dep_2_reexport::Trait2` | ::: replaced | LL | extern crate dep_2_reexport; | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` LL | extern crate dependency; | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate = help: you can use `cargo tree` to explore your dependency tree note: function defined here --> replaced | LL | pub fn do_something_trait(_: Box<dyn Trait2>) {} | ^^^^^^^^^^^^^^^^^^ ``` or if it is different crates that were renamed to the same name: ``` error[E0308]: mismatched types --> $DIR/type-mismatch-same-crate-name.rs:21:20 | LL | a::try_foo(foo2); | ---------- ^^^^ expected `main::a::Foo`, found a different `main::a::Foo` | | | arguments to this function are incorrect | note: two types coming from two different crates are different types even if they look the same --> $DIR/auxiliary/crate_a2.rs:1:1 | LL | pub struct Foo; | ^^^^^^^^^^^^^^ this is the found type `crate_a2::Foo` | ::: $DIR/auxiliary/crate_a1.rs:1:1 | LL | pub struct Foo; | ^^^^^^^^^^^^^^ this is the expected type `crate_a1::Foo` | ::: $DIR/type-mismatch-same-crate-name.rs:13:17 | LL | let foo2 = {extern crate crate_a2 as a; a::Foo}; | --------------------------- one type comes from crate `crate_a2` is used here, which is renamed locally to `a` ... LL | extern crate crate_a1 as a; | --------------------------- one type comes from crate `crate_a1` is used here, which is renamed locally to `a` note: function defined here --> $DIR/auxiliary/crate_a1.rs:10:8 | LL | pub fn try_foo(x: Foo){} | ^^^^^^^ error[E0308]: mismatched types --> $DIR/type-mismatch-same-crate-name.rs:27:20 | LL | a::try_bar(bar2); | ---------- ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` | | | arguments to this function are incorrect | note: two types coming from two different crates are different types even if they look the same --> $DIR/auxiliary/crate_a2.rs:3:1 | LL | pub trait Bar {} | ^^^^^^^^^^^^^ this is the found trait `crate_a2::Bar` | ::: $DIR/auxiliary/crate_a1.rs:3:1 | LL | pub trait Bar {} | ^^^^^^^^^^^^^ this is the expected trait `crate_a1::Bar` | ::: $DIR/type-mismatch-same-crate-name.rs:13:17 | LL | let foo2 = {extern crate crate_a2 as a; a::Foo}; | --------------------------- one trait comes from crate `crate_a2` is used here, which is renamed locally to `a` ... LL | extern crate crate_a1 as a; | --------------------------- one trait comes from crate `crate_a1` is used here, which is renamed locally to `a` note: function defined here --> $DIR/auxiliary/crate_a1.rs:11:8 | LL | pub fn try_bar(x: Box<Bar>){} | ^^^^^^^ ``` This new output unifies the E0308 errors detail with the pre-existing E0277 errors, and better differentiates the "`extern crate` renamed" and "same crate, different versions" cases.
2024-12-04Add failing testMichael Goulet-0/+25
2024-11-27Update tests to use new proc-macro headerEric Huss-27/+5
2024-11-17fixup some test directivesChris Denton-1/+1
2024-10-04Bless incremental tests.Camille GILLOT-2/+2
2024-09-14simd_shuffle: require index argument to be a vectorRalf Jung-1/+4
2024-09-09Ban non-array SIMDScott McMurray-3/+3
2024-08-21Rollup merge of #127279 - bvanjoi:fix-112680, r=petrochenkovMatthias Krüger-0/+34
use old ctx if has same expand environment during decode span Fixes #112680 The root reason why #112680 failed with incremental compilation on the second attempt is the difference in `opaque` between the span of the field [`ident`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_typeck/src/expr.rs#L2348) and the span in the incremental cache at `tcx.def_ident_span(field.did)`. - Let's call the span of `ident` as `span_a`, which is generated by [`apply_mark_internal`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_span/src/hygiene.rs#L553-L554). Its content is similar to: ```rs span_a_ctx -> SyntaxContextData { opaque: span_a_ctx, opaque_and_semitransparent: span_a_ctx, // .... } ``` - And call the span of `tcx.def_ident_span` as `span_b`, which is generated by [`decode_syntax_context`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_span/src/hygiene.rs#L1390). Its content is: ```rs span_b_ctx -> SyntaxContextData { opaque: span_b_ctx, // note `span_b_ctx` is not same as `span_a_ctx` opaque_and_semitransparent: span_b_ctx, // .... } ``` Although they have the same `parent` (both refer to the root) and `outer_expn`, I cannot find the specific connection between them. Therefore, I chose a solution that may not be the best: give up the incremental compile cache to ensure we can use `span_a` in this case. r? `@petrochenkov` Do you have any advice on this? Or perhaps this solution is acceptable?
2024-07-31Do not normalize constants eagerly.Camille GILLOT-2/+2
2024-07-29Perform instsimplify before inline to eliminate some trivial callsDianQK-1/+1
2024-07-05use old ctx if has same expand environment during decode spanbohan-0/+34
2024-06-20Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoeristerbors-0/+40
Trying to address an incremental compilation issues This pull request contains two independent changes, one makes it so when `try_force_from_dep_node` fails to recover a query - it marks the node as "red" instead of "green" and the second one makes Debug impl for `DepNode` less panicky if it encounters something from the previous compilation that doesn't map to anything in the current one. I'm not 100% confident that this is the correct approach, but so far I managed to find a bunch of comments suggesting that some things are allowed to fail in a certain way and changes I made are allowing for those things to fail this way and it fixes all the small reproducers I managed to find. Compilation panic this pull request avoids is caused by an automatically generated code on an associated type and it is not happening if something else marks it as outdated first (or close like that, but scenario is quite obscure). Fixes https://github.com/rust-lang/rust/issues/107226 Fixes https://github.com/rust-lang/rust/issues/125367
2024-06-19Allow for try_force_from_dep_node to failMichael Baikov-0/+40
The way it is implemented currently try_force_from_dep_node returns true as long as there's a function to force the query. It wasn't this way from the beginning, earlier version was producing forcing result and it was changed in https://github.com/rust-lang/rust/pull/89978, I couldn't find any comments addressing this change. One way it can fail is by failing to recover the query in DepNodeParams::recover - when we are trying to query something that no longer exists in the current environment
2024-06-19Taint infcx when reporting errorsOli Scherer-0/+2
2024-05-20Update tests/incremental/foreign.rsBen Kimock-22/+5
2024-04-21add test for incremental ICE: slice-pattern-const.rs #83085Matthias Krüger-0/+39
Fixes #83085
2024-04-06Add missing -Zquery-dep-graph to the spike-neg incr comp testsbjorn3-0/+2
This ensures that the tests actually test what they are meant to test rather than exitting immediately with an error that -Zquery-dep-graph has to be passed.
2024-04-03Remove MIR unsafe checkMatthew Jasper-7/+7
This also remove safety information from MIR.
2024-04-01Make sure to insert Sized bound first into clauses listMichael Goulet-1/+1
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-2/+0
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-02-25fix use of platform_intrinsics in testsRalf Jung-2/+2
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-496/+496
2024-02-13Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errorsbors-4/+4
Merge `impl_polarity` and `impl_trait_ref` queries Hopefully this is perf neutral. I want to finish https://github.com/rust-lang/rust/pull/120835 and stop using the HIR in `coherent_trait`, which should then give us a perf improvement.
2024-02-12Make impl_trait_ref into a query also returning more information about the implOli Scherer-4/+4
2024-02-12Tweak delayed bug mentions.Nicholas Nethercote-2/+2
Now that we have both `delayed_bug` and `span_delayed_bug`, it makes sense to use the generic term "delayed bug" more.