Skip to main content

rustc_middle/query/
modifiers.rs

1//! This contains documentation which is linked from query modifiers used in the `rustc_queries!` proc macro.
2#![allow(unused, non_camel_case_types)]
3// FIXME: Update and clarify documentation for these modifiers.
4
5/// # `desc` query modifier
6///
7/// The description of the query. This modifier is required on every query.
8pub struct desc;
9
10/// # `arena_cache` query modifier
11///
12/// Use this type for the in-memory cache.
13pub struct arena_cache;
14
15/// # `cache_on_disk_if` query modifier
16///
17/// Cache the query to disk if the `Block` returns true.
18pub struct cache_on_disk_if;
19
20/// # `cycle_fatal` query modifier
21///
22/// A cycle error for this query aborting the compilation with a fatal error.
23pub struct cycle_fatal;
24
25/// # `cycle_delay_bug` query modifier
26///
27/// A cycle error results in a delay_bug call
28pub struct cycle_delay_bug;
29
30/// # `cycle_stash` query modifier
31///
32/// A cycle error results in a stashed cycle error that can be unstashed and canceled later
33pub struct cycle_stash;
34
35/// # `no_hash` query modifier
36///
37/// Don't hash the result, instead just mark a query red if it runs
38pub struct no_hash;
39
40/// # `anon` query modifier
41///
42/// Generate a dep node based on the dependencies of the query
43pub struct anon;
44
45/// # `eval_always` query modifier
46///
47/// Always evaluate the query, ignoring its dependencies
48pub struct eval_always;
49
50/// # `depth_limit` query modifier
51///
52/// Whether the query has a call depth limit
53pub struct depth_limit;
54
55/// # `separate_provide_extern` query modifier
56///
57/// Use a separate query provider for local and extern crates
58pub struct separate_provide_extern;
59
60/// # `feedable` query modifier
61///
62/// Generate a `feed` method to set the query's value from another query.
63pub struct feedable;
64
65/// # `return_result_from_ensure_ok` query modifier
66///
67/// When this query is called via `tcx.ensure_ok()`, it returns
68/// `Result<(), ErrorGuaranteed>` instead of `()`. If the query needs to
69/// be executed, and that execution returns an error, the error result is
70/// returned to the caller.
71///
72/// If execution is skipped, a synthetic `Ok(())` is returned, on the
73/// assumption that a query with all-green inputs must have succeeded.
74///
75/// Can only be applied to queries with a return value of
76/// `Result<_, ErrorGuaranteed>`.
77pub struct return_result_from_ensure_ok;