3232//! - `arena_cache`: Use an arena for in-memory caching of the query result.
3333//! - `cache_on_disk_if { ... }`: Cache the query result to disk if the provided block evaluates to
3434//! true. The query key identifier is available for use within the block, as is `tcx`.
35- //! - `cycle_fatal`: If a dependency cycle is detected, abort compilation with a fatal error.
3635//! - `cycle_delay_bug`: If a dependency cycle is detected, emit a delayed bug instead of aborting immediately.
3736//! - `cycle_stash`: If a dependency cycle is detected, stash the error for later handling.
3837//! - `no_hash`: Do not hash the query result for incremental compilation; just mark as dirty if recomputed.
@@ -149,11 +148,11 @@ use crate::{dep_graph, mir, thir};
149148// which memoizes and does dep-graph tracking, wrapping around the actual
150149// `Providers` that the driver creates (using several `rustc_*` crates).
151150//
152- // The result type of each query must implement `Clone`, and additionally
153- // `ty::query::from_cycle_error::FromCycleError`, which produces an appropriate
151+ // The result type of each query must implement `Clone`. Additionally
152+ // `ty::query::from_cycle_error::FromCycleError` can be implemented which produces an appropriate
154153// placeholder (error) value if the query resulted in a query cycle.
155- // Queries marked with `cycle_fatal` do not need the latter implementation,
156- // as they will raise a fatal error on query cycles instead.
154+ // Queries without a `FromCycleError` implementation will raise a fatal error on query
155+ // cycles instead.
157156rustc_queries ! {
158157 /// Caches the expansion of a derive proc macro, e.g. `#[derive(Serialize)]`.
159158 /// The key is:
@@ -587,7 +586,6 @@ rustc_queries! {
587586 }
588587
589588 query is_panic_runtime( _: CrateNum ) -> bool {
590- cycle_fatal
591589 desc { "checking if the crate is_panic_runtime" }
592590 separate_provide_extern
593591 }
@@ -1318,7 +1316,6 @@ rustc_queries! {
13181316 /// Return the set of (transitive) callees that may result in a recursive call to `key`,
13191317 /// if we were able to walk all callees.
13201318 query mir_callgraph_cyclic( key: LocalDefId ) -> & ' tcx Option <UnordSet <LocalDefId >> {
1321- cycle_fatal
13221319 arena_cache
13231320 desc {
13241321 "computing (transitive) callees of `{}` that may recurse" ,
@@ -1329,7 +1326,6 @@ rustc_queries! {
13291326
13301327 /// Obtain all the calls into other local functions
13311328 query mir_inliner_callees( key: ty:: InstanceKind <' tcx>) -> & ' tcx [ ( DefId , GenericArgsRef <' tcx>) ] {
1332- cycle_fatal
13331329 desc {
13341330 "computing all local function calls in `{}`" ,
13351331 tcx. def_path_str( key. def_id( ) ) ,
@@ -1850,31 +1846,26 @@ rustc_queries! {
18501846 }
18511847
18521848 query is_compiler_builtins( _: CrateNum ) -> bool {
1853- cycle_fatal
18541849 desc { "checking if the crate is_compiler_builtins" }
18551850 separate_provide_extern
18561851 }
18571852 query has_global_allocator( _: CrateNum ) -> bool {
18581853 // This query depends on untracked global state in CStore
18591854 eval_always
1860- cycle_fatal
18611855 desc { "checking if the crate has_global_allocator" }
18621856 separate_provide_extern
18631857 }
18641858 query has_alloc_error_handler( _: CrateNum ) -> bool {
18651859 // This query depends on untracked global state in CStore
18661860 eval_always
1867- cycle_fatal
18681861 desc { "checking if the crate has_alloc_error_handler" }
18691862 separate_provide_extern
18701863 }
18711864 query has_panic_handler( _: CrateNum ) -> bool {
1872- cycle_fatal
18731865 desc { "checking if the crate has_panic_handler" }
18741866 separate_provide_extern
18751867 }
18761868 query is_profiler_runtime( _: CrateNum ) -> bool {
1877- cycle_fatal
18781869 desc { "checking if a crate is `#![profiler_runtime]`" }
18791870 separate_provide_extern
18801871 }
@@ -1883,22 +1874,18 @@ rustc_queries! {
18831874 cache_on_disk_if { true }
18841875 }
18851876 query required_panic_strategy( _: CrateNum ) -> Option <PanicStrategy > {
1886- cycle_fatal
18871877 desc { "getting a crate's required panic strategy" }
18881878 separate_provide_extern
18891879 }
18901880 query panic_in_drop_strategy( _: CrateNum ) -> PanicStrategy {
1891- cycle_fatal
18921881 desc { "getting a crate's configured panic-in-drop strategy" }
18931882 separate_provide_extern
18941883 }
18951884 query is_no_builtins( _: CrateNum ) -> bool {
1896- cycle_fatal
18971885 desc { "getting whether a crate has `#![no_builtins]`" }
18981886 separate_provide_extern
18991887 }
19001888 query symbol_mangling_version( _: CrateNum ) -> SymbolManglingVersion {
1901- cycle_fatal
19021889 desc { "getting a crate's symbol mangling version" }
19031890 separate_provide_extern
19041891 }
0 commit comments