Skip to content
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
91021ccc790478a1a89c003e7d32b8d155ae6aae
562dee4820c458d823175268e41601d4c060588a
17 changes: 10 additions & 7 deletions src/queries/incremental-compilation-in-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,13 @@ deal with all of the above but so far that seemed like more trouble than it woul

## Query modifiers

> FIXME: Make [`rustc_middle::query::modifiers`] the home for query modifier documentation,
> and migrate all other useful modifier docs there after verifying that they are still accurate.

[`rustc_middle::query::modifiers`]:
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/query/modifiers/index.html


The query system allows for applying [modifiers][mod] to queries.
These modifiers affect certain aspects of how the system treats the query with
respect to incremental compilation:
Expand All @@ -437,6 +444,9 @@ respect to incremental compilation:
as an optimization because the system can skip recording dependencies in
the first place.

- `no_force` - Never "force" the dep nodes for this query, even if the query's
key type is recoverable.

- `no_hash` - Applying `no_hash` to a query tells the system to not compute
the fingerprint of the query's result.
This has two consequences:
Expand Down Expand Up @@ -475,13 +485,6 @@ respect to incremental compilation:
For example, it makes no sense to store values from upstream
crates in the cache because they are already available in the upstream crate's metadata.

- `anon` - This attribute makes the system use "anonymous" dep-nodes for the given query.
An anonymous dep-node is not identified by the corresponding query key.
Instead, its ID is computed from the IDs of its dependencies.
This allows the red-green system to do its change detection even if there is no
query key available for a given dep-node -- something which is needed for
handling trait selection because it is not based on queries.

[mod]: ../query.html#adding-a-new-kind-of-query


Expand Down
Loading