forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodifiers.rs
More file actions
73 lines (63 loc) · 2.94 KB
/
modifiers.rs
File metadata and controls
73 lines (63 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! This contains documentation which is linked from query modifiers used in the `rustc_queries!` proc macro.
//!
//! The dummy items in this module are used to enable hover documentation for
//! modifier names in the query list, and to allow find-all-references to list
//! all queries that use a particular modifier.
#![allow(unused, non_camel_case_types)]
// tidy-alphabetical-start
//
/// # `anon` query modifier
///
/// Generate a dep node based not on the query key, but on the query's dependencies.
pub(crate) struct anon;
/// # `arena_cache` query modifier
///
/// Query return values must impl `Copy` and be small, but some queries must return values that
/// doesn't meet those criteria. Queries marked with this modifier have their values allocated in
/// an arena and the query returns a reference to the value. There are two cases.
/// - If the provider function returns `T` then the query will return `&'tcx T`.
/// - If the provider function returns `Option<T>` then the query will return `Option<&'tcx T>`.
///
/// The query plumbing takes care of the arenas and the type manipulations.
pub(crate) struct arena_cache;
/// # `cache_on_disk_if { ... }` query modifier
///
/// Cache the query result to disk if the provided block evaluates to true. The query key
/// identifier is available for use within the block, as is `tcx`.
pub(crate) struct cache_on_disk_if;
/// # `depth_limit` query modifier
///
/// Impose a recursion call depth limit on the query to prevent stack overflow.
pub(crate) struct depth_limit;
/// # `desc { ... }` query modifier
///
/// The human-readable description of the query, for diagnostics and profiling. Required for every
/// query. The block should contain a `format!`-style string literal followed by optional
/// arguments. The query key identifier is available for use within the block, as is `tcx`.
pub(crate) struct desc;
/// # `eval_always` query modifier
///
/// Queries with this modifier do not track their dependencies, and are treated as always having a
/// red (dirty) dependency instead. This is necessary for queries that interact with state that
/// isn't tracked by the query system.
///
/// It can also improve performance for queries that are so likely to be dirtied by any change that
/// it's not worth tracking their actual dependencies at all.
///
/// As with all queries, the return value is still cached in memory for the rest of the compiler
/// session.
pub(crate) struct eval_always;
/// # `feedable` query modifier
///
/// Generate a `feed` method to set the query's value from another query.
pub(crate) struct feedable;
/// # `no_hash` query modifier
///
/// Do not hash the query's return value for incremental compilation. If the value needs to be
/// recomputed, always mark its node as red (dirty).
pub(crate) struct no_hash;
/// # `separate_provide_extern` query modifier
///
/// Use separate query provider functions for local and extern crates.
pub(crate) struct separate_provide_extern;
// tidy-alphabetical-end