about summary refs log tree commit diff
path: root/src/test/incremental
AgeCommit message (Collapse)AuthorLines
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-1/+1
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-09Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakisYuki Okushi-4/+6
Remove defaultness from ImplItem. This information is not really used anywhere, except HIR pretty-printing. This makes ImplItem and TraitItem more similar.
2022-02-03Remove defaultness from ImplItem.Camille GILLOT-4/+6
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-1/+1
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2022-01-26Bless incremental tests.Camille GILLOT-194/+212
2022-01-18Properly track `DepNode`s in trait evaluation provisional cacheAaron Hill-0/+24
Fixes #92987 During evaluation of an auto trait predicate, we may encounter a cycle. This causes us to store the evaluation result in a special 'provisional cache;. If we later end up determining that the type can legitimately implement the auto trait despite the cycle, we remove the entry from the provisional cache, and insert it into the evaluation cache. Additionally, trait evaluation creates a special anonymous `DepNode`. All queries invoked during the predicate evaluation are added as outoging dependency edges from the `DepNode`. This `DepNode` is then store in the evaluation cache - if a different query ends up reading from the cache entry, it will also perform a read of the stored `DepNode`. As a result, the cached evaluation will still end up (transitively) incurring all of the same dependencies that it would if it actually performed the uncached evaluation (e.g. a call to `type_of` to determine constituent types). Previously, we did not correctly handle the interaction between the provisional cache and the created `DepNode`. Storing an evaluation result in the provisional cache would cause us to lose the `DepNode` created during the evaluation. If we later moved the entry from the provisional cache to the evaluation cache, we would use the `DepNode` associated with the evaluation that caused us to 'complete' the cycle, not the evaluatoon where we first discovered the cycle. As a result, future reads from the evaluation cache would miss some incremental compilation dependencies that would have otherwise been added if the evaluation was *not* cached. Under the right circumstances, this could lead to us trying to force a query with a no-longer-existing `DefPathHash`, since we were missing the (red) dependency edge that would have caused us to bail out before attempting forcing. This commit makes the provisional cache store the `DepNode` create during the provisional evaluation. When we move an entry from the provisional cache to the evaluation cache, we create a *new* `DepNode` that has dependencies going to *both* of the evaluation `DepNodes` we have available. This ensures that cached reads will incur all of the necessary dependency edges.
2022-01-17Rollup merge of #92825 - pierwill:rustc-version-force-rename, r=Mark-SimulacrumMatthias Krüger-1/+1
Rename environment variable for overriding rustc version
2022-01-12Rename environment variable for overriding rustc versionpierwill-1/+1
2022-01-12Migrate inline assembly incremental tests to asm!Tomasz Miąsko-77/+53
2022-01-09Auto merge of #92534 - Aaron1011:hash-hir, r=petrochenkovbors-2/+2
Hash `Ident` spans in all HIR structures This PR removes all of the `#[stable_hasher(project(name))]` attributes used in HIR structs. While these attributes are not known to be causing any issues in practice, we need to hash these in order for the incremental system to work correctly - a query could be otherwise be incorrectly marked green when a change occures in one of the `Span`s that it uses.
2022-01-04Auto merge of #92259 - Aaron1011:normal-mod-hashing, r=michaelwoeristerbors-0/+28
Remove special-cased stable hashing for HIR module All other 'containers' (e.g. `impl` blocks) hashed their contents in the normal, order-dependent way. However, `Mod` was hashing its contents in a (sort-of) order-independent way. However, the exact order is exposed to consumers through `Mod.item_ids`, and through query results like `hir_module_items`. Therefore, stable hashing needs to take the order of items into account, to avoid fingerprint ICEs. Unforuntately, I was unable to directly build a reproducer for the ICE, due to the behavior of `Fingerprint::combine_commutative`. This operation swaps the upper and lower `u64` when constructing the result, which makes the function non-associative. Since we start the hashing of module items by combining `Fingerprint::ZERO` with the first item, it's difficult to actually build an example where changing the order of module items leaves the final hash unchanged. However, this appears to have been hit in practice in #92218 While we're not able to reproduce it, the fact that proc-macros are involved (which can give an entire module the same span, preventing any span-related invalidations) makes me confident that the root cause of that issue is our method of hashing module items. This PR removes all of the special handling for `Mod`, instead deriving a `HashStable` implementation. This makes `Mod` consistent with other 'contains' like `Impl`, which hash their contents through the typical derive of `HashStable`.
2022-01-03Hash `Ident` spans in all HIR structuresAaron Hill-2/+2
This PR removes all of the `#[stable_hasher(project(name))]` attributes used in HIR structs. While these attributes are not known to be causing any issues in practice, we need to hash these in order for the incremental system to work correctly - a query could be otherwise be incorrectly marked green when a change occures in one of the `Span`s that it uses.
2022-01-03Auto merge of #92179 - Aaron1011:incr-loaded-from-disk, r=michaelwoeristerbors-1/+5
Add `#[rustc_clean(loaded_from_disk)]` to assert loading of query result Currently, you can use `#[rustc_clean]` to assert to that a particular query (technically, a `DepNode`) is green or red. However, a green `DepNode` does not mean that the query result was actually deserialized from disk - we might have never re-run a query that needed the result. Some incremental tests are written as regression tests for ICEs that occured during query result decoding. Using `#[rustc_clean(loaded_from_disk="typeck")]`, you can now assert that the result of a particular query (e.g. `typeck`) was actually loaded from disk, in addition to being green.
2021-12-31Rollup merge of #92405 - bjorn3:more_needs_inline_asm, r=lqdMatthias Krüger-0/+2
Add a couple needs-asm-support headers to tests This will allow them to be ignored by codegen backends that don't support inline asm.
2021-12-29Add a couple needs-asm-support headers to testsbjorn3-0/+2
This will allow them to be ignored by codegen backends that don't support inline asm.
2021-12-24Remove special-cased stable hashing for HIR moduleAaron Hill-0/+28
All other 'containers' (e.g. `impl` blocks) hashed their contents in the normal, order-dependent way. However, `Mod` was hashing its contents in a (sort-of) order-independent way. However, the exact order is exposed to consumers through `Mod.item_ids`, and through query results like `hir_module_items`. Therefore, stable hashing needs to take the order of items into account, to avoid fingerprint ICEs. Unforuntately, I was unable to directly build a reproducer for the ICE, due to the behavior of `Fingerprint::combine_commutative`. This operation swaps the upper and lower `u64` when constructing the result, which makes the function non-associative. Since we start the hashing of module items by combining `Fingerprint::ZERO` with the first item, it's difficult to actually build an example where changing the order of module items leaves the final hash unchanged. However, this appears to have been hit in practice in #92218 While we're not able to reproduce it, the fact that proc-macros are involved (which can give an entire module the same span, preventing any span-related invalidations) makes me confident that the root cause of that issue is our method of hashing module items. This PR removes all of the special handling for `Mod`, instead deriving a `HashStable` implementation. This makes `Mod` consistent with other 'contains' like `Impl`, which hash their contents through the typical derive of `HashStable`.
2021-12-23Import `SourceFile`s from crate before decoding foreign `Span`Aaron Hill-0/+44
Fixes #92163 Fixes #92014 When writing to the incremental cache, we encode all `Span`s we encounter, regardless of whether or not their `SourceFile` comes from the local crate, or from a foreign crate. When we decode a `Span`, we use the `StableSourceFileId` we encoded to locate the matching `SourceFile` in the current session. If this id corresponds to a `SourceFile` from another crate, then we need to have already imported that `SourceFile` into our current session. This usually happens automatically during resolution / macro expansion, when we try to resolve definitions from other crates. In certain cases, however, we may try to load a `Span` from a transitive dependency without having ever imported the `SourceFile`s from that crate, leading to an ICE. This PR fixes the issue by calling `imported_source_files()` when we encounter a `SourceFile` with a foreign `CrateNum`. This ensures that all `SourceFile`s from that crate are imported into the current session.
2021-12-21Add `#[rustc_clean(loaded_from_disk)]` to assert loading of query resultAaron Hill-1/+5
Currently, you can use `#[rustc_clean]` to assert to that a particular query (technically, a `DepNode`) is green or red. However, a green `DepNode` does not mean that the query result was actually deserialized from disk - we might have never re-run a query that needed the result. Some incremental tests are written as regression tests for ICEs that occured during query result decoding. Using `#[rustc_clean(loaded_from_disk="typeck")]`, you can now assert that the result of a particular query (e.g. `typeck`) was actually loaded from disk, in addition to being green.
2021-12-14Auto merge of #91728 - Amanieu:stable_asm, r=joshtriplettbors-4/+2
Stabilize asm! and global_asm! Tracking issue: #72016 It's been almost 2 years since the original [RFC](https://github.com/rust-lang/rfcs/pull/2850) was posted and we're finally ready to stabilize this feature! The main changes in this PR are: - Removing `asm!` and `global_asm!` from the prelude as per the decision in #87228. - Stabilizing the `asm` and `global_asm` features. - Removing the unstable book pages for `asm` and `global_asm`. The contents are moved to the [reference](https://github.com/rust-lang/reference/pull/1105) and [rust by example](https://github.com/rust-lang/rust-by-example/pull/1483). - All links to these pages have been removed to satisfy the link checker. In a later PR these will be replaced with links to the reference or rust by example. - Removing the automatic suggestion for using `llvm_asm!` instead of `asm!` if you're still using the old syntax, since it doesn't work anymore with `asm!` no longer being in the prelude. This only affects code that predates the old LLVM-style `asm!` being renamed to `llvm_asm!`. - Updating `stdarch` and `compiler-builtins`. - Updating all the tests. r? `@joshtriplett`
2021-12-12Stabilize asm! and global_asm!Amanieu d'Antras-4/+2
They are also removed from the prelude as per the decision in https://github.com/rust-lang/rust/issues/87228. stdarch and compiler-builtins are updated to work with the new, stable asm! and global_asm! macros.
2021-12-10update testsEllen-1/+1
2021-12-03Add test with `#[rustc_evaluate_where_clauses]`Wesley Wiser-1/+2
As suggested via reviewer feedback.
2021-12-03Add test for evaluate_obligation: Ok(EvaluatedToOkModuloRegions) ICEWesley Wiser-0/+117
Adds the minimial repro test case from #85360. The fix for #85360 was supposed to be #85868 however the repro was resolved in the 2021-07-05 nightly while #85360 didn't land until 2021-09-03. The reason for that is d34a3a401b4e44f289a4d5bf53da83367cbb6aa7 **also** resolves that issue. To test if #85868 actually fixes #85360, I reverted d34a3a401b4e44f289a4d5bf53da83367cbb6aa7 and found that #85868 does indeed resolve #85360. With that question resolved, add a test case to our incremental test suite for the original Ok(EvaluatedToOkModuloRegions) ICE. Thanks to @lqd for helping track this down!
2021-11-21Simplify for loop desugarCameron Steffen-1/+1
2021-11-20Change `trait_defs.rs` incremental hash testEsteban Kuber-3/+3
`predicates_of` no longer changes when changing a trait's front matter because we no longer include the trait's span in the identity trait obligation.
2021-11-12Add `-Zassert-incr-state` to assert state of incremental cachepierwill-2/+3
2021-10-22Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwcoYuki Okushi-4/+4
Don't mark for loop iter expression as desugared We typically don't mark spans of lowered things as desugared. This helps Clippy rightly discern when code is (not) from expansion. This was discovered by ``@flip1995`` at https://github.com/rust-lang/rust-clippy/pull/7789#issuecomment-939289501.
2021-10-18Add test for debug logging during incremental compilationTyson Nottingham-0/+24
Debug logging during incremental compilation had been broken for some time, until #89343 fixed it (among other things). Add a test so this is less likely to break without being noticed. This test is nearly a copy of the `src/test/ui/rustc-rust-log.rs` test, but tests debug logging in the incremental compliation code paths.
2021-10-15Use more lowered spans in for loopCameron Steffen-3/+3
2021-10-15Don't mark for loop head span with desugaringCameron Steffen-1/+1
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-0/+41
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+15
2021-10-07Remove untracked vtable-const-allocation cache from tcxMichael Woerister-0/+27
2021-10-06Do not re-hash foreign spans.Camille GILLOT-0/+11
2021-09-20Bless incremental tests.Camille GILLOT-7/+11
2021-09-11Rebase fallout.Camille GILLOT-2/+2
2021-09-10Duplicate tests for incremental spans mode.Camille GILLOT-1096/+2532
2021-09-02Report cycle error using 'deepest' obligation in the cycleAaron Hill-1/+2
2021-08-30`feature(const_param_types)` -> `feature(adt_const_params)`lcnr-3/+3
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-95/+16
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-13/+13
:sparkles:
2021-08-23Rollup merge of #88230 - steffahn:a_an, r=oli-obkMara Bos-1/+1
Fix typos “a”→“an” Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an. While automation was used to find these, every change was checked manually. Changes in submodules get separate PRs: * https://github.com/rust-lang/stdarch/pull/1201 * https://github.com/rust-lang/cargo/pull/9821 * https://github.com/rust-lang/miri/pull/1874 * https://github.com/rust-lang/rls/pull/1746 * https://github.com/rust-analyzer/rust-analyzer/pull/9984 _folks @ rust-analyzer are fast at merging…_ * https://github.com/rust-analyzer/rust-analyzer/pull/9985 * https://github.com/rust-analyzer/rust-analyzer/pull/9987 * https://github.com/rust-analyzer/rust-analyzer/pull/9989 _For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._ <hr> This has some overlap with #88226, but neither is a strict superset of the other. If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.
2021-08-22Auto merge of #88166 - BoxyUwU:const-equate-canon, r=lcnrbors-0/+203
canonicalize consts before calling try_unify_abstract_consts query Fixes #88022 Fixes #86953 Fixes #77708 Fixes #82034 Fixes #85031 these ICEs were all caused by calling the `try_unify_abstract_consts` query with inference vars in substs r? `@lcnr`
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-19Revert "Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, ↵Erik Desjardins-1/+1
r=oli-obk"" This reverts commit 8e11199a153218c13a419df37a9bb675181cccb7.
2021-08-19regression testsEllen-0/+203
2021-08-18add testsEllen-0/+169
2021-08-15Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk"Erik Desjardins-1/+1
This reverts commit 8007b506ac5da629f223b755f5a5391edd5f6d01, reversing changes made to e55c13e1099b78b1a485202fabc9c1b10b1f1d15.
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-7/+5
2021-08-07Run RemoveZsts at mir-opt-level=1Erik Desjardins-1/+1
Effectively reverts commit 6960bc9696b05b15d8d89ece2fef14e6e62a43fc.