Apply feedback.
This commit is contained in:
parent
4840ad250b
commit
2154b85ca4
|
|
@ -402,11 +402,11 @@ would save.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Query Attributes
|
## Query Modifiers
|
||||||
|
|
||||||
The query system allows for applying attributes to queries. These attributes
|
The query system allows for applying [modifiers][mod] to queries. These
|
||||||
affect certain aspects of how the system treats the query with respect to
|
modifiers affect certain aspects of how the system treats the query with
|
||||||
incremental compilation:
|
respect to incremental compilation:
|
||||||
|
|
||||||
- `eval_always` - A query with the `eval_always` attribute is re-executed
|
- `eval_always` - A query with the `eval_always` attribute is re-executed
|
||||||
unconditionally during incremental compilation. I.e. the system will not
|
unconditionally during incremental compilation. I.e. the system will not
|
||||||
|
|
@ -433,7 +433,7 @@ incremental compilation:
|
||||||
|
|
||||||
- `cache_on_disk_if` - This attribute is what determines which query results
|
- `cache_on_disk_if` - This attribute is what determines which query results
|
||||||
are persisted in the incremental compilation query result cache. The
|
are persisted in the incremental compilation query result cache. The
|
||||||
attribute takes an expression that allows to make per query invocation
|
attribute takes an expression that allows per query invocation
|
||||||
decisions. For example, it makes no sense to store values from upstream
|
decisions. For example, it makes no sense to store values from upstream
|
||||||
crates in the cache because they are already available in the upstream
|
crates in the cache because they are already available in the upstream
|
||||||
crate's metadata.
|
crate's metadata.
|
||||||
|
|
@ -445,6 +445,8 @@ incremental compilation:
|
||||||
query key available for a given dep-node -- something which is needed for
|
query key available for a given dep-node -- something which is needed for
|
||||||
handling trait selection because it is not based on queries.
|
handling trait selection because it is not based on queries.
|
||||||
|
|
||||||
|
[mod]: ../query.html#adding-a-new-kind-of-query
|
||||||
|
|
||||||
|
|
||||||
## The Projection Query Pattern
|
## The Projection Query Pattern
|
||||||
|
|
||||||
|
|
@ -482,7 +484,7 @@ directly depended on `monolithic_query` then all of them would have had to be
|
||||||
re-evaluated.
|
re-evaluated.
|
||||||
|
|
||||||
This pattern works even without `eval_always` and `no_hash` but the two
|
This pattern works even without `eval_always` and `no_hash` but the two
|
||||||
attributes can be used to avoid unnecessary overhead. If the monolithic query
|
modifiers can be used to avoid unnecessary overhead. If the monolithic query
|
||||||
is likely to change at any minor modification of the compiler's input it makes
|
is likely to change at any minor modification of the compiler's input it makes
|
||||||
sense to mark it as `eval_always`, thus getting rid of its dependency tracking
|
sense to mark it as `eval_always`, thus getting rid of its dependency tracking
|
||||||
cost. And it always makes sense to mark the monolithic query as `no_hash`
|
cost. And it always makes sense to mark the monolithic query as `no_hash`
|
||||||
|
|
|
||||||
|
|
@ -224,9 +224,10 @@ Let's go over them one by one:
|
||||||
of `Steal` for more details. New uses of `Steal` should **not** be
|
of `Steal` for more details. New uses of `Steal` should **not** be
|
||||||
added without alerting `@rust-lang/compiler`.
|
added without alerting `@rust-lang/compiler`.
|
||||||
- **Query modifiers:** various flags and options that customize how the
|
- **Query modifiers:** various flags and options that customize how the
|
||||||
query is processed.
|
query is processed (mostly with respect to [incremental compilation][incrcomp]).
|
||||||
|
|
||||||
[Key]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/query/keys/trait.Key.html
|
[Key]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/query/keys/trait.Key.html
|
||||||
|
[incrcomp]: queries/incremental-compilation-in-detail.html#query-modifiers
|
||||||
|
|
||||||
So, to add a query:
|
So, to add a query:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue