Commit Graph

48 Commits

Author SHA1 Message Date
bors 1d96de2a20 Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoerister
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-20 09:06:16 +00:00
Michael Baikov db5ed4bd79 Allow for try_force_from_dep_node to fail
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-19 07:21:41 -04:00
Oli Scherer 3594a19f2a Taint infcx when reporting errors 2024-06-19 04:41:56 +00:00
Ben Kimock 30379f9bcc Update tests/incremental/foreign.rs 2024-05-20 11:13:10 -04:00
Matthias Krüger 8088ea0ba0 add test for incremental ICE: slice-pattern-const.rs #83085
Fixes #83085
2024-04-21 14:45:00 +02:00
bjorn3 809e0c7453 Add missing -Zquery-dep-graph to the spike-neg incr comp tests
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-06 13:36:16 +00:00
Matthew Jasper a277c901d9 Remove MIR unsafe check
This also remove safety information from MIR.
2024-04-03 08:50:12 +00:00
Michael Goulet f2fd2d8c70 Make sure to insert Sized bound first into clauses list 2024-04-01 21:41:45 -04:00
Alex Crichton cf6d6050f7 Update test directives for `wasm32-wasip1`
* 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-03-11 09:36:35 -07:00
Ralf Jung c1d0e489e5 fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
许杰友 Jieyou Xu (Joe) 6e48b96692
[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives 2024-02-22 16:04:04 +00:00
bors d26b417112 Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errors
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-13 02:48:49 +00:00
Oli Scherer 916951efcc Make impl_trait_ref into a query also returning more information about the impl 2024-02-12 09:42:41 +00:00
Nicholas Nethercote d4b77f64e4 Tweak delayed bug mentions.
Now that we have both `delayed_bug` and `span_delayed_bug`, it makes
sense to use the generic term "delayed bug" more.
2024-02-12 18:39:20 +11:00
Oli Scherer eab2adb660 Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
Esteban Küber 0df6dfdc78 fix rebase 2024-02-01 22:38:16 +00:00
Esteban Küber 95d9009f49 Change incr comp test when adding explicit `Sized` bound
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-02-01 03:31:03 +00:00
Vadim Petrochenkov 64b6b5b6ce hir: Simplify `hir_owner_nodes` query
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-30 15:00:52 +03:00
jyn c3e4c457fe Track `verbose` and `verbose_internals`
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-20 08:00:09 -05:00
Camille GILLOT 20a8a23cb3 Bless incremental tests. 2024-01-16 23:49:39 +00:00
Camille GILLOT aa9968881c Disable opt in incremental test. 2023-12-24 20:08:58 +00:00
Camille GILLOT 75e0824e81 Bless incremental tests. 2023-12-24 20:08:57 +00:00
Martin Nordholts d46df80c73 rustc_codegen_ssa: Don't let `IncorrectCguReuseType` errors get lost
In [100753], `IncorrectCguReuseType` accidentally stopped being emitted.
Begin emitting it again rather than just blindly dropping it, and adjust
tests accordingly.

[100753]: 706452eba7 (diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84)
2023-12-19 20:20:40 +01:00
Martin Nordholts 41c9404133 tests: CGU tests require build-pass, not check-pass (remove FIXME)
CGU tests require CGU code to be exercised. We can't merely do "cargo
check" on these tests.
2023-12-12 15:48:48 +01:00
Nicholas Nethercote 5d1d384443 Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
2023-12-02 09:01:19 +11:00
Jubilee Young e9a009fd1a Remove asmjs from tests 2023-10-28 23:11:03 -07:00
Camille GILLOT b704697fba Bless incremental tests. 2023-10-06 15:46:11 +00:00
Matthias Krüger 3ee2c526df
Rollup merge of #116263 - ferrocene:pa-more-bare-metal-fixes, r=oli-obk
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-29 22:27:52 +02:00
Pietro Albini 3853774df8
mark relevant tests as requiring unwinding 2023-09-29 14:24:40 +02:00
Oli Scherer f5df26dbec Unconditionally run `RevealAll` pass and run it earlier 2023-09-28 16:13:38 +00:00
Oli Scherer 4457ef2c6d Forbid old-style `simd_shuffleN` intrinsics 2023-08-03 09:29:00 +00:00
Camille GILLOT a4a5e5b4ae Querify unused trait check. 2023-07-16 21:51:00 +00:00
Camille GILLOT 6d7304167c Bless incremental test. 2023-07-10 16:01:18 +00:00
Michael Goulet 847d50453c Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
bors 642c92e630 Auto merge of #112002 - saethlin:enable-sroa, r=oli-obk,scottmcm
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-06-01 10:47:14 +00:00
Ben Kimock 79ba7b307d Enable ScalarReplacementOfAggregates 2023-05-31 19:18:16 -04:00
Oli Scherer d030ece6f7 Only rewrite valtree-constants to patterns and keep other constants opaque 2023-05-31 14:02:57 +00:00
Maybe Waffle 8d406b8459 Add a test for issue 110457 2023-05-29 13:49:20 +00:00
Camille GILLOT 3bb5d1dfc1 Delay a bug when overwriting fed value. 2023-05-17 20:42:03 +00:00
Camille GILLOT 222acaa23e Add incremental test. 2023-05-17 20:28:42 +00:00
bjorn3 8a08514dbd Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
Wesley Wiser 4e8b642646 Turn on ConstDebugInfo pass. 2023-04-22 23:41:48 +02:00
Camille GILLOT e5565b1aaa Add incremental tests. 2023-04-20 18:01:15 +00:00
Michael Woerister 6117c06306 incr.comp.: Make sure dependencies are recorded when feeding queries during eval-always queries. 2023-04-04 14:38:46 +02:00
Dylan DPC e9c25b4ad5
Rollup merge of #105793 - lukas-code:circular-deps, r=Mark-Simulacrum
Add note for mismatched types because of circular dependencies

If you have crate A with a dependency on crate B, and crate B with a dev-dependency on A, then you might see "mismatched types" errors on types that seem to be equal. This PR adds a note that explains that the types are different, because crate B is compiled twice, one time with `cfg(test)` and one time without.

I haven't found a good way to create circular dependencies in UI tests, so I abused the incremental tests instead. As a bonus, incremental tests support "cpass" now.

related to https://github.com/rust-lang/rust/issues/22750
2023-03-19 15:33:55 +05:30
Camille GILLOT e7b998c02a Bless incremental test. 2023-03-14 20:52:42 +01:00
Lukas Markeffsky 97915ab943 Add note for mismatched types with circular dependencies 2023-03-05 15:06:03 +01:00
Albert Larsan cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00