about summary refs log tree commit diff
path: root/tests/incremental
AgeCommit message (Collapse)AuthorLines
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.
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-1/+5
2024-02-01fix rebaseEsteban Küber-1/+1
2024-02-01Change incr comp test when adding explicit `Sized` boundEsteban Küber-2/+2
Given the previous change to add implicit `Sized` bounds only if there isn't already an explicit `Sized` bound, now the incr comp machinery doesn't consider adding the explicit bound as being dirty, as long as `-Zincremental-ignore-spans` is set.
2024-01-30hir: Simplify `hir_owner_nodes` queryVadim Petrochenkov-849/+849
The query accept arbitrary DefIds, not just owner DefIds. The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom. Also rename the query to `opt_hir_owner_nodes`.
2024-01-20Track `verbose` and `verbose_internals`jyn-3/+3
bjorn3 says: > On errors we don't finalize the incr comp cache, but non-fatal diagnostics are cached afaik. Otherwise we would have to replay the query in question, which we may not be able to do if the query key is not reconstructible from the dep node fingerprint. So we must track these flags to avoid replaying incorrect diagnostics.
2024-01-16Bless incremental tests.Camille GILLOT-570/+533
2023-12-24Disable opt in incremental test.Camille GILLOT-2/+2
2023-12-24Bless incremental tests.Camille GILLOT-3/+3
2023-12-19rustc_codegen_ssa: Don't let `IncorrectCguReuseType` errors get lostMartin Nordholts-10/+14
In [100753], `IncorrectCguReuseType` accidentally stopped being emitted. Begin emitting it again rather than just blindly dropping it, and adjust tests accordingly. [100753]: https://github.com/rust-lang/rust/pull/100753/commits/706452eba74026c51e8d0fa30aee2497c69eafc0#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84
2023-12-12tests: CGU tests require build-pass, not check-pass (remove FIXME)Martin Nordholts-3/+3
CGU tests require CGU code to be exercised. We can't merely do "cargo check" on these tests.
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-2/+2
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-10-28Remove asmjs from testsJubilee Young-5/+0
2023-10-06Bless incremental tests.Camille GILLOT-10/+10
2023-09-29Rollup merge of #116263 - ferrocene:pa-more-bare-metal-fixes, r=oli-obkMatthias Krüger-0/+1
More fixes for running the test suite on a bare metal target This PR adds more fixes needed to run the test suite on bare metal targets (in this case, without unwinding and with static relocations). There is no CI job exercising tests without unwinds, but I can confirm this worked in Ferrocene's CI.
2023-09-29mark relevant tests as requiring unwindingPietro Albini-0/+1
2023-09-28Unconditionally run `RevealAll` pass and run it earlierOli Scherer-1/+1
2023-08-03Forbid old-style `simd_shuffleN` intrinsicsOli Scherer-3/+3
2023-07-16Querify unused trait check.Camille GILLOT-2/+2
2023-07-10Bless incremental test.Camille GILLOT-1/+1
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-4/+39
2023-06-01Auto merge of #112002 - saethlin:enable-sroa, r=oli-obk,scottmcmbors-1/+2
Enable ScalarReplacementOfAggregates in optimized builds Like MatchBranchSimplification, this pass is known to produce significant runtime improvements in Cranelift artifacts, and I believe based on the perf runs here that the primary effect of this pass is to empower MatchBranchSimplification. ScalarReplacementOfAggregates on its own has little effect on anything, but when this was rebased up to include https://github.com/rust-lang/rust/pull/112001 we started seeing significant and majority-positive results. Based on the fact that we see most of the regressions in debug builds (https://github.com/rust-lang/rust/pull/112002#issuecomment-1566270144) and some rather significant ones in cycles and wall time, I'm only enabling this in optimized builds at the moment.
2023-05-31Enable ScalarReplacementOfAggregatesBen Kimock-1/+2
2023-05-31Only rewrite valtree-constants to patterns and keep other constants opaqueOli Scherer-10/+3
2023-05-29Add a test for issue 110457Maybe Waffle-0/+137